Skip to content

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

Description

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'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions