- Update to 1.3.1:

* Remove use of mock.
- Drop patch remove-mock.patch, included upstream.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-console-scripts?expand=0&rev=18
This commit is contained in:
Steve Kowalik 2022-03-21 01:24:09 +00:00 committed by Git OBS Bridge
parent c031ebc0a5
commit 4bd6b13613
5 changed files with 11 additions and 57 deletions

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c6c3daae9cf9fbed0e655072128938600193dc002a5cf1b187248644ba02857
size 14238

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3cadbf67cfb30a1eb1cc1e9e69cb6de44c3a648426f1b9bf63e85d97357fc7f
size 14365

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 21 01:22:50 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 1.3.1:
* Remove use of mock.
- Drop patch remove-mock.patch, included upstream.
-------------------------------------------------------------------
Fri Mar 18 04:14:59 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -19,14 +19,12 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pytest-console-scripts
Version: 1.3
Version: 1.3.1
Release: 0
Summary: Pytest plugin for testing console scripts
License: MIT
URL: https://github.com/kvas-it/pytest-console-scripts
Source: https://files.pythonhosted.org/packages/source/p/pytest-console-scripts/pytest-console-scripts-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#kvas-it/pytest-console-scripts#53
Patch0: remove-mock.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros

View File

@ -1,51 +0,0 @@
From 0c2218a456372e64e8cf11afc8c65ce858670fc7 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Thu, 17 Mar 2022 15:54:59 +1100
Subject: [PATCH] Remove use of external mock
As of Python 3.3, mock has been included in the standard library, and in
fact, the test code makes use of that fact. However, the main plugin did
not, so remove its usage, and drop it from setup.py. Also clean up the
definition of StreamMock to boot.
---
pytest_console_scripts.py | 11 ++---------
setup.py | 2 +-
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/pytest_console_scripts.py b/pytest_console_scripts.py
index 7dca21d..822b8d6 100644
--- a/pytest_console_scripts.py
+++ b/pytest_console_scripts.py
@@ -9,17 +9,10 @@
import sys
import traceback
-import mock
+from unittest import mock
import pytest
-if sys.version_info.major == 2:
- # We can't use io.StringIO for mocking stdout/stderr in Python 2
- # because printing byte strings to it triggers unicode errors and
- # there's code in stdlib that does that (e.g. traceback module).
- import StringIO
- StreamMock = StringIO.StringIO
-else:
- StreamMock = io.StringIO
+StreamMock = io.StringIO
def pytest_addoption(parser):
diff --git a/setup.py b/setup.py
index 7bbbced..e0bdcf8 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ def read(fname):
long_description=read('README.md'),
long_description_content_type='text/markdown',
py_modules=['pytest_console_scripts'],
- install_requires=['pytest>=4.0.0', 'mock>=2.0.0'],
+ install_requires=['pytest>=4.0.0'],
python_requires='>=3.6',
setup_requires=['setuptools-scm'],
classifiers=[