Accepting request 971978 from devel:languages:python:pytest
OBS-URL: https://build.opensuse.org/request/show/971978 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-shutil?expand=0&rev=7
This commit is contained in:
commit
6c42935ff8
72
pytest-fixtures-pr171-remove-mock.patch
Normal file
72
pytest-fixtures-pr171-remove-mock.patch
Normal file
@ -0,0 +1,72 @@
|
||||
diff --git a/pytest-shutil/pytest_shutil/run.py b/pytest-shutil/pytest_shutil/run.py
|
||||
index c5b421d..7d46aea 100644
|
||||
--- a/pytest-shutil/pytest_shutil/run.py
|
||||
+++ b/pytest-shutil/pytest_shutil/run.py
|
||||
@@ -11,7 +11,12 @@
|
||||
from contextlib import closing
|
||||
import subprocess
|
||||
|
||||
-from mock import patch
|
||||
+try:
|
||||
+ from unittest.mock import patch
|
||||
+except ImportError:
|
||||
+ # python 2
|
||||
+ from mock import patch
|
||||
+
|
||||
import execnet
|
||||
from six.moves import cPickle # @UnresolvedImport
|
||||
|
||||
diff --git a/pytest-shutil/setup.py b/pytest-shutil/setup.py
|
||||
index 4126831..3513d3e 100644
|
||||
--- a/pytest-shutil/setup.py
|
||||
+++ b/pytest-shutil/setup.py
|
||||
@@ -24,10 +24,11 @@
|
||||
|
||||
install_requires = ['six',
|
||||
'execnet',
|
||||
- 'contextlib2',
|
||||
+ 'contextlib2;python_version<"3"',
|
||||
'pytest',
|
||||
- 'path.py',
|
||||
- 'mock',
|
||||
+ 'path; python_version >= "3.7"',
|
||||
+ 'path.py; python_version < "3.7"',
|
||||
+ 'mock; python_version<"3.3"',
|
||||
'termcolor'
|
||||
]
|
||||
|
||||
diff --git a/pytest-shutil/tests/integration/test_run_integration.py b/pytest-shutil/tests/integration/test_run_integration.py
|
||||
index d92c9da..bf20f3a 100644
|
||||
--- a/pytest-shutil/tests/integration/test_run_integration.py
|
||||
+++ b/pytest-shutil/tests/integration/test_run_integration.py
|
||||
@@ -8,7 +8,10 @@
|
||||
import textwrap
|
||||
from uuid import uuid4
|
||||
|
||||
-import mock
|
||||
+try:
|
||||
+ from unittest import mock
|
||||
+except ImportError:
|
||||
+ import mock
|
||||
|
||||
from pytest_shutil import run, workspace
|
||||
from pytest_shutil.env import no_cov
|
||||
diff --git a/pytest-shutil/tests/unit/test_run.py b/pytest-shutil/tests/unit/test_run.py
|
||||
index 612d20d..c520e85 100644
|
||||
--- a/pytest-shutil/tests/unit/test_run.py
|
||||
+++ b/pytest-shutil/tests/unit/test_run.py
|
||||
@@ -3,7 +3,13 @@
|
||||
from subprocess import PIPE, STDOUT
|
||||
|
||||
import pytest
|
||||
-from mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+
|
||||
+try:
|
||||
+ from unittest.mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+except ImportError:
|
||||
+ # python 2
|
||||
+ from mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+
|
||||
from six.moves import cPickle
|
||||
|
||||
from pytest_shutil import run
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 21 21:51:01 UTC 2022 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
- Fixup fallout from SUSE's crusade against mock in the
|
||||
pytest-fixtures family
|
||||
* Replace remove-mock.patch with
|
||||
pytest-fixtures-pr171-remove-mock.patch
|
||||
* gh#man-group/pytest-plugins#171
|
||||
* Update build and runtime requirements
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 23 06:45:41 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
|
@ -25,10 +25,9 @@ Summary: A goodie-bag of unix shell and environment tools for pytest
|
||||
License: MIT
|
||||
URL: https://github.com/manahl/pytest-plugins
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-shutil/pytest-shutil-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM Adapted from gh#man-group/pytest-plugins#66bf6670f3ce10106d57a77ff634a8e5c9c3a39a
|
||||
Patch0: remove-mock.patch
|
||||
# PATCH-FEATURE-UPSTREAM pytest-fixtures-pr171-remove-mock.patch -- gh#man-group#pytest-plugins#171
|
||||
Patch1: pytest-fixtures-pr171-remove-mock.patch
|
||||
BuildRequires: %{python_module execnet}
|
||||
BuildRequires: %{python_module path.py}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools-git}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
@ -37,15 +36,28 @@ BuildRequires: %{python_module termcolor}
|
||||
BuildRequires: fdupes
|
||||
%if %{with python2}
|
||||
BuildRequires: python-contextlib2
|
||||
BuildRequires: python-mock
|
||||
BuildRequires: python-path.py
|
||||
%endif
|
||||
%if 0%{?suse_version} < 1550
|
||||
BuildRequires: python3-path.py
|
||||
%else
|
||||
BuildRequires: %{python_module path}
|
||||
%endif
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-execnet
|
||||
%if 0%{suse_version} < 1550
|
||||
Requires: python-path.py
|
||||
%else
|
||||
Requires: python-path
|
||||
%endif
|
||||
Requires: python-pytest
|
||||
Requires: python-six
|
||||
Requires: python-termcolor
|
||||
%ifpython2
|
||||
Requires: python-contextlib2
|
||||
Requires: python-mock
|
||||
Requires: python-path.py
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
|
||||
@ -56,10 +68,7 @@ This library is a goodie-bag of Unix shell and environment management
|
||||
tools for automated tests.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n pytest-shutil-%{version}
|
||||
sed -i '/contextlib2/d' setup.py
|
||||
sed -i '/path.\py/d' setup.py
|
||||
sed -i '/mock/d' setup.py
|
||||
%autosetup -p2 -n pytest-shutil-%{version}
|
||||
|
||||
%build
|
||||
%python_build
|
||||
@ -74,6 +83,7 @@ sed -i '/mock/d' setup.py
|
||||
%files %{python_files}
|
||||
%doc README.md CHANGES.md
|
||||
%license LICENSE
|
||||
%{python_sitelib}/*
|
||||
%{python_sitelib}/pytest_shutil
|
||||
%{python_sitelib}/pytest_shutil-%{version}*-info
|
||||
|
||||
%changelog
|
||||
|
@ -1,53 +0,0 @@
|
||||
Index: pytest-shutil-1.7.0/pytest_shutil/run.py
|
||||
===================================================================
|
||||
--- pytest-shutil-1.7.0.orig/pytest_shutil/run.py
|
||||
+++ pytest-shutil-1.7.0/pytest_shutil/run.py
|
||||
@@ -11,7 +11,12 @@ import textwrap
|
||||
from contextlib import closing
|
||||
import subprocess
|
||||
|
||||
-from mock import patch
|
||||
+try:
|
||||
+ from unittest.mock import patch
|
||||
+except ImportError:
|
||||
+ # python 2
|
||||
+ from mock import patch
|
||||
+
|
||||
import execnet
|
||||
from six.moves import cPickle # @UnresolvedImport
|
||||
|
||||
Index: pytest-shutil-1.7.0/tests/integration/test_run_integration.py
|
||||
===================================================================
|
||||
--- pytest-shutil-1.7.0.orig/tests/integration/test_run_integration.py
|
||||
+++ pytest-shutil-1.7.0/tests/integration/test_run_integration.py
|
||||
@@ -8,7 +8,10 @@ import inspect
|
||||
import textwrap
|
||||
from uuid import uuid4
|
||||
|
||||
-import mock
|
||||
+try:
|
||||
+ from unittest import mock
|
||||
+except ImportError:
|
||||
+ import mock
|
||||
|
||||
from pytest_shutil import run, workspace
|
||||
from pytest_shutil.env import no_cov
|
||||
Index: pytest-shutil-1.7.0/tests/unit/test_run.py
|
||||
===================================================================
|
||||
--- pytest-shutil-1.7.0.orig/tests/unit/test_run.py
|
||||
+++ pytest-shutil-1.7.0/tests/unit/test_run.py
|
||||
@@ -3,7 +3,13 @@ from uuid import uuid4
|
||||
from subprocess import PIPE, STDOUT
|
||||
|
||||
import pytest
|
||||
-from mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+
|
||||
+try:
|
||||
+ from unittest.mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+except ImportError:
|
||||
+ # python 2
|
||||
+ from mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+
|
||||
from six.moves import cPickle
|
||||
|
||||
from pytest_shutil import run
|
Loading…
x
Reference in New Issue
Block a user