From 29aa58b7fbdf4866c1dc5968b37155939c2c216e3fd922d85f3b5107b74a61b1 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 13 Sep 2025 09:47:58 +0000 Subject: [PATCH] - update to 1.2.0: * --asyncio-debug CLI option and asyncio_debug configuration option to enable asyncio debug mode for the default event loop. * A pytest.UsageError for invalid configuration values of asyncio_default_fixture_loop_scope and asyncio_default_test_loop_scope. * Compatibility with the Pyright type checker * RuntimeError: There is no current event loop in thread 'MainThread' when any test unsets the event loop (such as when using asyncio.run and asyncio.Runner). * Deprecation warning when decorating an asynchronous fixture with @pytest.fixture in strict mode. The warning message now refers to the correct package. * Bump the minimum required version of tox to v4.28. This change is only relevant if you use the tox.ini file provided by pytest-asyncio to run tests. * Extend dependency on typing-extensions>=4.12 from Python<3.10 to Python<3.13. * Propagation of ContextVars from async fixtures to other fixtures and tests on Python 3.10 and older * Cancellation of tasks when the loop_scope ends * Warning when the current event loop is closed by a test * Error about missing loop when calling functions requiring a loop in the finally clause of a task * An error that could cause duplicate warnings to be issued * Added runtime dependency on backports.asyncio.runner for use with Python 3.10 and older - drop pytest84.patch (upstream) * Deprecates the optional scope keyword argument to pytest.mark.asyncio OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-asyncio?expand=0&rev=59 --- pytest-asyncio-1.0.0.tar.gz | 3 -- pytest-asyncio-1.2.0.tar.gz | 3 ++ pytest84.patch | 78 ----------------------------------- python-pytest-asyncio.changes | 37 ++++++++++++++++- python-pytest-asyncio.spec | 10 +++-- 5 files changed, 44 insertions(+), 87 deletions(-) delete mode 100644 pytest-asyncio-1.0.0.tar.gz create mode 100644 pytest-asyncio-1.2.0.tar.gz delete mode 100644 pytest84.patch diff --git a/pytest-asyncio-1.0.0.tar.gz b/pytest-asyncio-1.0.0.tar.gz deleted file mode 100644 index a542c15..0000000 --- a/pytest-asyncio-1.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd0235c0c60badfb2f845942d19c54ce0280d1cea073ec1ec36037321c900fd8 -size 45557 diff --git a/pytest-asyncio-1.2.0.tar.gz b/pytest-asyncio-1.2.0.tar.gz new file mode 100644 index 0000000..a613aa9 --- /dev/null +++ b/pytest-asyncio-1.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c2f599c88c9417b539628c7dc538c465829c31d634e39e1972f6dccd71b31a5 +size 48706 diff --git a/pytest84.patch b/pytest84.patch deleted file mode 100644 index 1beb6f5..0000000 --- a/pytest84.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 8c6612fda96f78a1df2f0d271426b7b6e3c10737 Mon Sep 17 00:00:00 2001 -From: Yao Zi -Date: Tue, 10 Jun 2025 16:17:11 +0000 -Subject: [PATCH] test: Adapt unmarked async tests in strict mode for pytest - 8.4.0 - -Async tests fail instead of skipping and warning with Pytest 8.4.0 if -no suitable async plugin is installed[1]. Adjust expectation of these -tests to pass the testsuite with Pytest 8.4.0. - -Link: https://docs.pytest.org/en/stable/changelog.html#pytest-8-4-0-2025-06-02 # [1] -Signed-off-by: Yao Zi ---- - tests/modes/test_strict_mode.py | 23 ++++++++++++++++++----- - 1 file changed, 18 insertions(+), 5 deletions(-) - -diff --git a/tests/modes/test_strict_mode.py b/tests/modes/test_strict_mode.py -index 52cbb251..44f54b7d 100644 ---- a/tests/modes/test_strict_mode.py -+++ b/tests/modes/test_strict_mode.py -@@ -2,7 +2,7 @@ - - from textwrap import dedent - --from pytest import Pytester -+from pytest import Pytester, version_tuple as pytest_version - - - def test_strict_mode_cmdline(pytester: Pytester): -@@ -95,7 +95,10 @@ async def test_anything(): - ) - ) - result = pytester.runpytest_subprocess("--asyncio-mode=strict", "-W default") -- result.assert_outcomes(skipped=1, warnings=1) -+ if pytest_version >= (8, 4, 0): -+ result.assert_outcomes(failed=1, skipped=0, warnings=0) -+ else: -+ result.assert_outcomes(skipped=1, warnings=1) - result.stdout.fnmatch_lines(["*async def functions are not natively supported*"]) - - -@@ -117,7 +120,11 @@ async def test_anything(any_fixture): - ) - ) - result = pytester.runpytest_subprocess("--asyncio-mode=strict", "-W default") -- result.assert_outcomes(skipped=1, warnings=2) -+ -+ if pytest_version >= (8, 4, 0): -+ result.assert_outcomes(failed=1, skipped=0, warnings=2) -+ else: -+ result.assert_outcomes(skipped=1, warnings=2) - result.stdout.fnmatch_lines( - [ - "*async def functions are not natively supported*", -@@ -149,7 +156,10 @@ async def test_anything(any_fixture): - ) - ) - result = pytester.runpytest_subprocess("--asyncio-mode=strict", "-W default") -- result.assert_outcomes(passed=1, failed=0, skipped=0, warnings=1) -+ if pytest_version >= (8, 4, 0): -+ result.assert_outcomes(passed=1, failed=0, skipped=0, warnings=2) -+ else: -+ result.assert_outcomes(passed=1, failed=0, skipped=0, warnings=1) - result.stdout.fnmatch_lines( - [ - "*warnings summary*", -@@ -193,7 +203,10 @@ async def test_anything(any_fixture): - ) - ) - result = pytester.runpytest_subprocess("--asyncio-mode=strict", "-W default") -- result.assert_outcomes(passed=1, warnings=1) -+ if pytest_version >= (8, 4, 0): -+ result.assert_outcomes(passed=1, warnings=2) -+ else: -+ result.assert_outcomes(passed=1, warnings=1) - result.stdout.fnmatch_lines( - [ - "*warnings summary*", diff --git a/python-pytest-asyncio.changes b/python-pytest-asyncio.changes index 1a08732..25b3f10 100644 --- a/python-pytest-asyncio.changes +++ b/python-pytest-asyncio.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Sat Sep 13 09:39:08 UTC 2025 - Dirk Müller + +- update to 1.2.0: + * --asyncio-debug CLI option and asyncio_debug configuration + option to enable asyncio debug mode for the default event + loop. + * A pytest.UsageError for invalid configuration values of + asyncio_default_fixture_loop_scope and + asyncio_default_test_loop_scope. + * Compatibility with the Pyright type checker + * RuntimeError: There is no current event loop in thread + 'MainThread' when any test unsets the event loop (such as + when using asyncio.run and asyncio.Runner). + * Deprecation warning when decorating an asynchronous fixture + with @pytest.fixture in strict mode. The warning message now + refers to the correct package. + * Bump the minimum required version of tox to v4.28. This + change is only relevant if you use the tox.ini file provided + by pytest-asyncio to run tests. + * Extend dependency on typing-extensions>=4.12 from Python<3.10 + to Python<3.13. + * Propagation of ContextVars from async fixtures to other + fixtures and tests on Python 3.10 and older + * Cancellation of tasks when the loop_scope ends + * Warning when the current event loop is closed by a test + * Error about missing loop when calling functions requiring a + loop in the finally clause of a task + * An error that could cause duplicate warnings to be issued + * Added runtime dependency on backports.asyncio.runner for use + with Python 3.10 and older +- drop pytest84.patch (upstream) + ------------------------------------------------------------------- Fri Jun 20 12:27:13 UTC 2025 - Markéta Machová @@ -94,9 +127,9 @@ Tue Oct 8 15:42:52 UTC 2024 - Markéta Machová - Update to 0.24.0 * BREAKING: Updated minimum supported pytest version to v8.2.0 * Adds an optional loop_scope keyword argument to pytest.mark.asyncio. - * Deprecates the optional scope keyword argument to pytest.mark.asyncio + * Deprecates the optional scope keyword argument to pytest.mark.asyncio for API consistency with pytest_asyncio.fixture. - * Fixes a bug that caused module-scoped async fixtures to fail when + * Fixes a bug that caused module-scoped async fixtures to fail when reused in other modules * Fixes a bug that caused duplicate markers in async tests * Declare support for Python 3.13 diff --git a/python-pytest-asyncio.spec b/python-pytest-asyncio.spec index 592c154..dbc8a76 100644 --- a/python-pytest-asyncio.spec +++ b/python-pytest-asyncio.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-asyncio # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,22 +26,24 @@ %endif %{?sle15_python_module_pythons} Name: python-pytest-asyncio%{psuffix} -Version: 1.0.0 +Version: 1.2.0 Release: 0 Summary: Pytest support for asyncio License: Apache-2.0 URL: https://github.com/pytest-dev/pytest-asyncio Source: https://github.com/pytest-dev/pytest-asyncio/archive/v%{version}.tar.gz#/pytest-asyncio-%{version}.tar.gz -# PATCH-FIX-UPSTREAM https://github.com/pytest-dev/pytest-asyncio/commit/8c6612fda96f78a1df2f0d271426b7b6e3c10737 test: Adapt unmarked async tests in strict mode for pytest 8.4.0 -Patch0: pytest84.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module typing-extensions >= 4.12 if %python-base < 3.13} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: (python-pytest >= 8.2.0 with python-pytest < 9) +%if 0%{?python_version_nodots} < 313 +Requires: python-typing-extensions >= 4.12 +%endif BuildArch: noarch %if %{with test} BuildRequires: %{python_module hypothesis >= 5.7.1}