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

Get pytest metadata from stash object (fix #89) #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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