Skip to content

CollectReport object has no attribute 'duration' #3

@mesudip

Description

@mesudip

package versions:

pytest               7.4.0
pytest-github-report 0.0.1

Error Log

$ pytest --github-report
....
  File "/Users/project/venv/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1059, in _ensure_unconfigure
    self.hook.pytest_unconfigure(config=self)
  File "/Users/project/venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 433, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/project/venv/lib/python3.11/site-packages/pluggy/_manager.py", line 112, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/project/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 116, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/Users/project/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 80, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/project/venv/lib/python3.11/site-packages/pytest_github_report/plugin.py", line 126, in pytest_unconfigure
    report = make_github_report(config, reporter, stats)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/project/venv/lib/python3.11/site-packages/pytest_github_report/plugin.py", line 172, in make_github_report
    results_per_testfunc = extract_pytest_stats(reporter=reporter, outcomes=outcomes)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/project/venv/lib/python3.11/site-packages/pytest_github_report/plugin.py", line 111, in extract_pytest_stats
    results_per_testfunc[key]["duration"] += value.duration
                                             ^^^^^^^^^^^^^^
AttributeError: 'CollectReport' object has no attribute 'duration'. Did you mean: 'location'?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions