Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: CoverallsReporter() takes no arguments #79

Open
VovaMazur opened this issue Mar 2, 2023 · 1 comment
Open

TypeError: CoverallsReporter() takes no arguments #79

VovaMazur opened this issue Mar 2, 2023 · 1 comment

Comments

@VovaMazur
Copy link

Dear Sirs,

Trying to setup coveralls for pretty simple flask web app.
UT is done with coverage / unittest.

After the successful built (with TravisCI), coveralls command shows below error:
Traceback (most recent call last):
File "C:\Users\Asus\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\Asus\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\Documents\EPAM\Pet_projects\Python EPAM stream\venv\Scripts\coveralls.exe_main
.py", line 7, in
File "D:\Documents\EPAM\Pet_projects\Python EPAM stream\venv\lib\site-packages\coveralls_init
.py", line 93, in wear
source_files=coverage.coveralls(args.base_dir, ignore_errors=args.ignore_errors, merge_file=args.merge_file),
File "D:\Documents\EPAM\Pet_projects\Python EPAM stream\venv\lib\site-packages\coveralls\control.py", line 7, in coveralls
reporter = CoverallsReporter(self, self.config)
TypeError: CoverallsReporter() takes no arguments


Travis.yml script:

language: python
python:

  • "3.9" # current default Python on Travis CI

install:

  • pip install -r requirements.txt

script:

  • pylint --exit-zero manifestapp
  • coverage run -m unittest tests
  • coverage report

after_success:

  • coveralls
@bfontaine
Copy link

I encountered this error as well on xtools. The issue is that python-coveralls depends on coverage without specifying any version, so if coverage introduces breaking changes, like it did in the release 5.0.0 that removed the Reporter class, everything breaks.

Until this library is fixed, the solution is to downgrade coverage to 4.5.4. If you use pytest-cov, you’ll have to downgrade it as well to the last version that supported coverage<5.0, i.e. 2.10.1.

If you use Poetry, this is the solution:

poetry remove pytest-cov
poetry add --group dev [email protected]
poetry add --group dev [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants