Skip to content

Commit

Permalink
Update python-pytest-json-report to version 1.5.0 / rev 4 via SR 1101889
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/1101889
by user dgarcia + dimstar_suse
- Add pytest-metadata-3.patch to make it compatible with
  pytest-metadata 3.0.0 gh#numirias/pytest-json-report#90
  • Loading branch information
dgarcia authored and bmwiedemann committed Aug 2, 2023
1 parent d6fc69f commit 9292b3e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
Binary file modified packages/p/python-pytest-json-report/.files
Binary file not shown.
10 changes: 10 additions & 0 deletions packages/p/python-pytest-json-report/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@
</comment>
<requestid>1039086</requestid>
</revision>
<revision rev="4" vrev="2">
<srcmd5>2bf298953b7d39878653a96129dd1ee3</srcmd5>
<version>1.5.0</version>
<time>1690987806</time>
<user>dimstar_suse</user>
<comment>- Add pytest-metadata-3.patch to make it compatible with
pytest-metadata 3.0.0 gh#numirias/pytest-json-report#90
</comment>
<requestid>1101889</requestid>
</revision>
</revisionlist>
44 changes: 44 additions & 0 deletions packages/p/python-pytest-json-report/pytest-metadata-3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From db6174c82df854d5e390f09f4018710e7183461e Mon Sep 17 00:00:00 2001
From: eskerda <[email protected]>
Date: Mon, 12 Jun 2023 16:41:23 +0200
Subject: [PATCH] Get pytest metadata from stash object (fix #89)

---
pytest_jsonreport/plugin.py | 3 ++-
setup.py | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pytest_jsonreport/plugin.py b/pytest_jsonreport/plugin.py
index 6ee4ea5..f768d69 100644
--- a/pytest_jsonreport/plugin.py
+++ b/pytest_jsonreport/plugin.py
@@ -7,6 +7,7 @@
import time
import warnings

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

@@ -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:
diff --git a/setup.py b/setup.py
index 563fc6d..a60504f 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@
license='MIT',
install_requires=[
'pytest>=3.8.0',
- 'pytest-metadata',
+ 'pytest-metadata>=3.0.0',
],
entry_points={
'pytest11': [
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 2 06:39:01 UTC 2023 - Daniel Garcia <[email protected]>

- Add pytest-metadata-3.patch to make it compatible with
pytest-metadata 3.0.0 gh#numirias/pytest-json-report#90

-------------------------------------------------------------------
Wed Nov 30 10:54:12 UTC 2022 - Daniel Garcia <[email protected]>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-json-report
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -24,6 +24,8 @@ Summary: A pytest plugin to report test results as JSON files
License: MIT
URL: https://github.com/numirias/pytest-json-report
Source: https://files.pythonhosted.org/packages/source/p/pytest-json-report/pytest-json-report-%{version}.tar.gz
# PATCH-FIX-UPSTREAM pytest-metadata-3.patch gh#numirias/pytest-json-report#90
Patch0: pytest-metadata-3.patch
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
# SECTION test requirements
Expand Down

0 comments on commit 9292b3e

Please sign in to comment.