diff --git a/0001-fix-testcase-fail-with-Pytest6-and-Pytest5.patch b/0001-fix-testcase-fail-with-Pytest6-and-Pytest5.patch deleted file mode 100644 index f903fb581bc5ccaca767d854c9796b66cac5b940..0000000000000000000000000000000000000000 --- a/0001-fix-testcase-fail-with-Pytest6-and-Pytest5.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 41931fe962963874fc0128a4ef6ff6cf229b0c08 Mon Sep 17 00:00:00 2001 -From: lyn1001 -Date: Wed, 25 Aug 2021 14:23:06 +0800 -Subject: [PATCH] fix testcase fail with Pytest6 and Pytest5 - ---- - a/src/pytest_forked/__init__.py | 9 ++++++--- - a/testing/conftest.py | 5 ++++- - 2 files changed, 10 insertions(+), 4 deletions(-) - -diff --git a/src/pytest_forked/__init__.py b/src/pytest_forked/__init__.py -index 33b09d2..84fb768 100644 ---- a/src/pytest_forked/__init__.py -+++ b/src/pytest_forked/__init__.py -@@ -29,12 +29,15 @@ def pytest_addoption(parser): - help="box each test run in a separate process (unix)") - - --@pytest.mark.tryfirst -+@pytest.hookimpl(tryfirst=True) - def pytest_runtest_protocol(item): - if item.config.getvalue("forked"): -+ ihook = item.ihook -+ ihook.pytest_runtest_logstart(nodeid=item.nodeid, location=item.location) - reports = forked_run_report(item) - for rep in reports: -- item.ihook.pytest_runtest_logreport(report=rep) -+ ihook.pytest_runtest_logreport(report=rep) -+ ihook.pytest_runtest_logfinish(nodeid=item.nodeid, location=item.location) - return True - - -@@ -65,7 +68,7 @@ def forked_run_report(item): - - def report_process_crash(item, result): - try: -- from _pytest.compat import getfslineno -+ from _pytest._code import getfslineno - except ImportError: - # pytest<4.2 - path, lineno = item._getfslineno() -diff --git a/testing/conftest.py b/testing/conftest.py -index 745c00f..c01f73e 100644 ---- a/testing/conftest.py -+++ b/testing/conftest.py -@@ -8,10 +8,13 @@ pytest_plugins = "pytester" - def _divert_atexit(request, monkeypatch): - import atexit - atexit_fns = [] -+ -+ def atexit_register(func, *args, **kwargs): -+ atexit_fns.append(lambda: func(*args, **kwargs)) - - def finish(): - while atexit_fns: - atexit_fns.pop()() - -- monkeypatch.setattr(atexit, "register", atexit_fns.append) -+ monkeypatch.setattr(atexit, "register", atexit_register) - request.addfinalizer(finish) --- -2.23.0 - diff --git a/pytest-forked-1.0.2.tar.gz b/pytest-forked-1.0.2.tar.gz deleted file mode 100644 index df676ae3ac6ab2d14f77e7dd7ba319a95ad5a408..0000000000000000000000000000000000000000 Binary files a/pytest-forked-1.0.2.tar.gz and /dev/null differ diff --git a/pytest-forked-1.3.0.tar.gz b/pytest-forked-1.3.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..13bb2e800e4bea1bd236c12ad8dcf9a07a9ba0f8 Binary files /dev/null and b/pytest-forked-1.3.0.tar.gz differ diff --git a/python-pytest-forked.spec b/python-pytest-forked.spec index 1c523528b0413cc256c232af1ca17c2475645784..119650fdf73a51d88aace623fd42124bee411f87 100644 --- a/python-pytest-forked.spec +++ b/python-pytest-forked.spec @@ -5,15 +5,14 @@ C++ libraries that might crash the process. To use the plugin, simply use the\ --forked argument when invoking py.test. Name: python-%{pypi_name} -Version: 1.0.2 -Release: 2 +Version: 1.3.0 +Release: 1 Summary: py.test plugin for running tests in isolated forked subprocesses License: MIT URL: https://github.com/pytest-dev/pytest-forked -Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/62/92/2d418d7b0c9d68a2e885b66d7f6805f9678ce56ad2b3a77669437b2d139a/%{pypi_name}-%{version}.tar.gz BuildArch: noarch -Patch1: 0001-fix-testcase-fail-with-Pytest6-and-Pytest5.patch BuildRequires: python3-devel BuildRequires: python3-py python3-pytest python3-setuptools_scm @@ -49,6 +48,11 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} testing %{python3_sitelib}/pytest_forked* %changelog +* Fri Mar 22 2024 wangjing - 1.3.0-1 +- Upgrade package python3-pytest-forked to version 1.3.0 +- Remove `0001-fix-testcase-fail-with-Pytest6-and-Pytest5.patch` as 1.3.0 already includes it +- Major change: Support for pytest <= 6 + * Wed Aug 25 2021 liyanan - 1.0.2-2 - fix test case fail with Pytest6 and Pytest5