forked from pool/python-pytest-subprocess
- update to 1.5.3:
* #171, #178: Allow to access keyword arguments passed to Popen. * #180: Fixed an incorrect wait timeout calculation. * #170: Wrapped ProcessDispatcher.dispatch into FakePopenWrapper as it was causing TypeError when Popen is used as a type. * #169: Get rid of using thread in AsyncFakePopen as it causes thread.join() to hang indefinitely. * #162: Include tests (and docs) and sdist correctly, and stop installing them to site-packages. * #163: Add support for Python 3.12. * #160: Changed pytest entrypoint to avoid error while loading plugin with -p argument. * #128: Add tests directory to sdist. - switch to gh tarball, which includes the tests handled out of tree before - add py314-fix-tests.patch to fix tests with python 3.14 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-subprocess?expand=0&rev=10
This commit is contained in:
53
py314-fix-tests.patch
Normal file
53
py314-fix-tests.patch
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
From be30d9a94ba45afb600717e3fcd95b8b2ff2c60e Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Fri, 23 May 2025 21:59:14 +0200
|
||||||
|
Subject: [PATCH] Fix test_examples on Python 3.14 (#185)
|
||||||
|
|
||||||
|
This is basically a followup of https://github.com/aklajnert/pytest-subprocess/pull/148
|
||||||
|
---
|
||||||
|
tests/test_examples.py | 28 ++++++++++++++++------------
|
||||||
|
1 file changed, 16 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_examples.py b/tests/test_examples.py
|
||||||
|
index 5a27604..df849f3 100644
|
||||||
|
--- a/tests/test_examples.py
|
||||||
|
+++ b/tests/test_examples.py
|
||||||
|
@@ -1,3 +1,4 @@
|
||||||
|
+import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
@@ -39,18 +40,21 @@ def test_documentation(testdir, rst_file):
|
||||||
|
" os.chdir(os.path.dirname(__file__))\n\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
- event_loop_fixture = (
|
||||||
|
- "\n\n"
|
||||||
|
- "@pytest.fixture(autouse=True)\n"
|
||||||
|
- "def event_loop(request):\n"
|
||||||
|
- " policy = asyncio.get_event_loop_policy()\n"
|
||||||
|
- ' if sys.platform == "win32":\n'
|
||||||
|
- " loop = asyncio.ProactorEventLoop()\n"
|
||||||
|
- " else:\n"
|
||||||
|
- " loop = policy.get_event_loop()\n"
|
||||||
|
- " yield loop\n"
|
||||||
|
- " loop.close()\n"
|
||||||
|
- )
|
||||||
|
+ if sys.version_info < (3, 8):
|
||||||
|
+ event_loop_fixture = (
|
||||||
|
+ "\n\n"
|
||||||
|
+ "@pytest.fixture(autouse=True)\n"
|
||||||
|
+ "def event_loop(request):\n"
|
||||||
|
+ " policy = asyncio.get_event_loop_policy()\n"
|
||||||
|
+ ' if sys.platform == "win32":\n'
|
||||||
|
+ " loop = asyncio.ProactorEventLoop()\n"
|
||||||
|
+ " else:\n"
|
||||||
|
+ " loop = policy.get_event_loop()\n"
|
||||||
|
+ " yield loop\n"
|
||||||
|
+ " loop.close()\n"
|
||||||
|
+ )
|
||||||
|
+ else:
|
||||||
|
+ event_loop_fixture = ""
|
||||||
|
|
||||||
|
code_blocks = "\n".join(get_code_blocks(ROOT_DIR / rst_file))
|
||||||
|
testdir.makepyfile(
|
||||||
BIN
pytest-subprocess-1.5.0.tar.gz
(Stored with Git LFS)
BIN
pytest-subprocess-1.5.0.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
python-pytest-subprocess-1.5.3-gh.tar.gz
Normal file
3
python-pytest-subprocess-1.5.3-gh.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:73eceba9ffe1408f8cf030b12e7268521cfe55655822e4a13d68dffac2dcaab8
|
||||||
|
size 36830
|
||||||
@@ -1,3 +1,25 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 15 09:11:10 UTC 2025 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 1.5.3:
|
||||||
|
* #171, #178: Allow to access keyword arguments passed to
|
||||||
|
Popen.
|
||||||
|
* #180: Fixed an incorrect wait timeout calculation.
|
||||||
|
* #170: Wrapped ProcessDispatcher.dispatch into
|
||||||
|
FakePopenWrapper as it was causing TypeError when Popen is
|
||||||
|
used as a type.
|
||||||
|
* #169: Get rid of using thread in AsyncFakePopen as it causes
|
||||||
|
thread.join() to hang indefinitely.
|
||||||
|
* #162: Include tests (and docs) and sdist correctly, and stop
|
||||||
|
installing them to site-packages.
|
||||||
|
* #163: Add support for Python 3.12.
|
||||||
|
* #160: Changed pytest entrypoint to avoid error while loading
|
||||||
|
plugin with -p argument.
|
||||||
|
* #128: Add tests directory to sdist.
|
||||||
|
- switch to gh tarball, which includes the tests handled out of
|
||||||
|
tree before
|
||||||
|
- add py314-fix-tests.patch to fix tests with python 3.14
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Apr 8 10:40:20 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
Mon Apr 8 10:40:20 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pytest-subprocess
|
# spec file for package python-pytest-subprocess
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-pytest-subprocess
|
Name: python-pytest-subprocess
|
||||||
Version: 1.5.0
|
Version: 1.5.3
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A plugin to fake subprocess for pytest
|
Summary: A plugin to fake subprocess for pytest
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/aklajnert/pytest-subprocess
|
URL: https://github.com/aklajnert/pytest-subprocess
|
||||||
Source0: https://files.pythonhosted.org/packages/source/p/pytest-subprocess/pytest-subprocess-%{version}.tar.gz
|
Source0: https://github.com/aklajnert/pytest-subprocess/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}-gh.tar.gz
|
||||||
Source1: tests.tar.xz
|
Patch1: https://github.com/aklajnert/pytest-subprocess/commit/be30d9a94ba45afb600717e3fcd95b8b2ff2c60e.patch#/py314-fix-tests.patch
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
@@ -48,9 +48,9 @@ A pytest plugin to fake subprocess for pytest. The plugin adds the
|
|||||||
register subprocess results so you won't need to rely on the real processes.
|
register subprocess results so you won't need to rely on the real processes.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -a1 -n pytest-subprocess-%{version}
|
%autosetup -p1 -n pytest-subprocess-%{version}
|
||||||
|
|
||||||
chmod -x LICENSE README.rst pytest_subprocess/py.typed pytest_subprocess.egg-info/*
|
chmod -x LICENSE README.rst pytest_subprocess/py.typed
|
||||||
sed -Ei "s/\r$//" README.rst
|
sed -Ei "s/\r$//" README.rst
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@@ -62,7 +62,8 @@ sed -Ei "s/\r$//" README.rst
|
|||||||
|
|
||||||
%check
|
%check
|
||||||
# Docs dir is missing from tarball
|
# Docs dir is missing from tarball
|
||||||
%pytest -k "not test_documentation"
|
# recursive imports due to building outside git
|
||||||
|
%pytest -k "not (test_documentation or test_universal_newlines or test_text)"
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
|
|||||||
BIN
tests.tar.xz
(Stored with Git LFS)
BIN
tests.tar.xz
(Stored with Git LFS)
Binary file not shown.
Reference in New Issue
Block a user