forked from pool/python-pytest-subprocess
- Update to 1.6.0
## Features * #206: Add fp.regex() for regex-based command argument matching. * #103: Improve matching commands that contain quoted arguments. ## Bug fixes * #207: Fix poll() not reflecting returncode when a callback is registered. * #205: Fix stdin not respecting text mode when text=True or encoding is set. * #192: Fix ResourceWarning for unclosed file handles in test_universal_newlines and test_text by explicitly closing process.stdout after reading, preventing intermittent failures on Python 3.12+. * #196: Handle stderr=STDOUT when stdout is a file handle. * #194: Patch imported subprocess.Popen aliases. * #186: Support file handles in stdout and stderr. ## Other changes * #197: Officially support Python 3.14 and 3.15. - Drop patch py314-fix-tests.patch, merged upstream. - Drop unneeded _service file.
This commit was merged in pull request #3.
This commit is contained in:
@@ -1,3 +1,26 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 12 02:20:09 UTC 2026 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.6.0:
|
||||
## Features
|
||||
* #206: Add fp.regex() for regex-based command argument matching.
|
||||
* #103: Improve matching commands that contain quoted arguments.
|
||||
## Bug fixes
|
||||
* #207: Fix poll() not reflecting returncode when a callback is registered.
|
||||
* #205: Fix stdin not respecting text mode when text=True or encoding is
|
||||
set.
|
||||
* #192: Fix ResourceWarning for unclosed file handles in
|
||||
test_universal_newlines and test_text by explicitly closing
|
||||
process.stdout after reading, preventing intermittent failures on
|
||||
Python 3.12+.
|
||||
* #196: Handle stderr=STDOUT when stdout is a file handle.
|
||||
* #194: Patch imported subprocess.Popen aliases.
|
||||
* #186: Support file handles in stdout and stderr.
|
||||
## Other changes
|
||||
* #197: Officially support Python 3.14 and 3.15.
|
||||
- Drop patch py314-fix-tests.patch, merged upstream.
|
||||
- Drop unneeded _service file.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 14 04:33:37 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
|
||||
@@ -18,14 +18,12 @@
|
||||
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-pytest-subprocess
|
||||
Version: 1.5.3
|
||||
Version: 1.6.0
|
||||
Release: 0
|
||||
Summary: A plugin to fake subprocess for pytest
|
||||
License: MIT
|
||||
URL: https://github.com/aklajnert/pytest-subprocess
|
||||
Source0: https://github.com/aklajnert/pytest-subprocess/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}-gh.tar.gz
|
||||
# PATCH-FIX-UPSTREAM Based on gh#aklajnert/pytest-subprocess#be30d9a94ba45afb600717e3fcd95b8b2ff2c60e
|
||||
Patch1: py314-fix-tests.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<param name="scm">git</param>
|
||||
<param name="url">https://github.com/aklajnert/pytest-subprocess</param>
|
||||
<param name="revision">1.4.2</param>
|
||||
<param name="subdir">tests</param>
|
||||
<param name="filename">tests</param>
|
||||
<param name="version">_none_</param>
|
||||
</service>
|
||||
<service name="recompress" mode="disabled">
|
||||
<param name="compression">xz</param>
|
||||
<param name="file">tests.tar</param>
|
||||
</service>
|
||||
<service name="download_files" mode="disabled" />
|
||||
</services>
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
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(-)
|
||||
|
||||
Index: pytest-subprocess-1.5.3/tests/test_examples.py
|
||||
===================================================================
|
||||
--- pytest-subprocess-1.5.3.orig/tests/test_examples.py
|
||||
+++ pytest-subprocess-1.5.3/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(
|
||||
Index: pytest-subprocess-1.5.3/tests/test_asyncio.py
|
||||
===================================================================
|
||||
--- pytest-subprocess-1.5.3.orig/tests/test_asyncio.py
|
||||
+++ pytest-subprocess-1.5.3/tests/test_asyncio.py
|
||||
@@ -2,6 +2,7 @@ import asyncio
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
+import warnings
|
||||
|
||||
import anyio
|
||||
import pytest
|
||||
@@ -13,12 +14,14 @@ PYTHON = sys.executable
|
||||
|
||||
@pytest.fixture()
|
||||
def event_loop_policy(request):
|
||||
- if sys.platform.startswith("win"):
|
||||
- if request.node.name.startswith("test_invalid_event_loop"):
|
||||
- return asyncio.WindowsSelectorEventLoopPolicy()
|
||||
- else:
|
||||
- return asyncio.WindowsProactorEventLoopPolicy()
|
||||
- return asyncio.DefaultEventLoopPolicy()
|
||||
+ with warnings.catch_warnings():
|
||||
+ warnings.simplefilter('ignore', DeprecationWarning)
|
||||
+ if sys.platform.startswith("win"):
|
||||
+ if request.node.name.startswith("test_invalid_event_loop"):
|
||||
+ return asyncio.WindowsSelectorEventLoopPolicy()
|
||||
+ else:
|
||||
+ return asyncio.WindowsProactorEventLoopPolicy()
|
||||
+ return asyncio.DefaultEventLoopPolicy()
|
||||
|
||||
|
||||
if sys.platform.startswith("win") and sys.version_info < (3, 8):
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user