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

coverage 7.5+: AttributeError: 'PythonFileReporter' object has no attribute 'name' #282

Open
yamnikov-oleg opened this issue Jul 1, 2024 · 3 comments

Comments

@yamnikov-oleg
Copy link

coverage 7.5.0 is the first version which causes the error below. Downgrading to coverage 7.4.4 helps.

  Coverage statistics reporting failed
  Traceback (most recent call last):
    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 395, in report
      analysis = self.coverage._analyze(cu)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/coverage/control.py", line 940, in _analyze
      file_reporter = self._get_file_reporter(morf)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  TypeError: unhashable type: 'PythonFileReporter'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 335, in pytest_terminal_summary
      self._report_coverage()
    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 432, in _report_coverage
      reporter.report(None)
    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 409, in report
      test_id = cu.name
                ^^^^^^^
  AttributeError: 'PythonFileReporter' object has no attribute 'name'
@zaufi
Copy link

zaufi commented Aug 2, 2024

I also faced this!

@RichardDally
Copy link

coverage 7.5.0 is the first version which causes the error below. Downgrading to coverage 7.4.4 helps.


  Coverage statistics reporting failed

  Traceback (most recent call last):

    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 395, in report

      analysis = self.coverage._analyze(cu)

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/usr/local/lib/python3.11/site-packages/coverage/control.py", line 940, in _analyze

      file_reporter = self._get_file_reporter(morf)

                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  TypeError: unhashable type: 'PythonFileReporter'

  

  During handling of the above exception, another exception occurred:

  

  Traceback (most recent call last):

    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 335, in pytest_terminal_summary

      self._report_coverage()

    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 432, in _report_coverage

      reporter.report(None)

    File "/usr/local/lib/python3.11/site-packages/teamcity/pytest_plugin.py", line 409, in report

      test_id = cu.name

                ^^^^^^^

  AttributeError: 'PythonFileReporter' object has no attribute 'name'

Thank you, it worked for us. We are now waiting a bugfix from Jetbrains 😀

@racinmat
Copy link

Any update on this?

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

4 participants