Skip to content

Commit

Permalink
Get pytest metadata from stash object (fix #89)
Browse files Browse the repository at this point in the history
  • Loading branch information
eskerda committed Jun 12, 2023
1 parent c6f0bc9 commit db6174c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pytest_jsonreport/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time
import warnings

from pytest_metadata.plugin import metadata_key
import pytest
import _pytest.hookspec

Expand Down Expand Up @@ -228,7 +229,7 @@ def pytest_sessionfinish(self, session):
duration=time.time() - self._start_time,
exitcode=session.exitstatus,
root=str(session.fspath),
environment=getattr(self._config, '_metadata', {}),
environment=self._config.stash.get(metadata_key, {}),
summary=serialize.make_summary(self._json_tests, **summary_data),
)
if not self._config.option.json_report_summary:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
license='MIT',
install_requires=[
'pytest>=3.8.0',
'pytest-metadata',
'pytest-metadata>=3.0.0',
],
entry_points={
'pytest11': [
Expand Down

0 comments on commit db6174c

Please sign in to comment.