[packages/python-pyfakefs] - updated to 3.7.2; 3.4.x didn't support python 3.8 - removed outdated tests patch
qboosh
qboosh at pld-linux.org
Thu May 14 22:13:49 CEST 2020
commit 937394ee6af1e4796e43430cf94ab7275de0adfa
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu May 14 22:14:15 2020 +0200
- updated to 3.7.2; 3.4.x didn't support python 3.8
- removed outdated tests patch
python-pyfakefs-tests.patch | 31 -------------------------
python-pyfakefs.spec | 56 +++++++++++++++++++++++++++++++++++----------
2 files changed, 44 insertions(+), 43 deletions(-)
---
diff --git a/python-pyfakefs.spec b/python-pyfakefs.spec
index 058cc12..d50073c 100644
--- a/python-pyfakefs.spec
+++ b/python-pyfakefs.spec
@@ -8,28 +8,36 @@
Summary: Fake file system that mocks the Python 2 file system modules
Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 2 dla plików
Name: python-pyfakefs
-Version: 3.4.3
-Release: 2
+Version: 3.7.2
+Release: 1
License: Apache v2.0
Group: Libraries/Python
#Source0Download: https://github.com/jmcgeheeiv/pyfakefs/releases
Source0: https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}/pyfakefs-%{version}.tar.gz
-# Source0-md5: 8044a683bc025c0e2b2594b7d8de1083
-Patch0: %{name}-tests.patch
+# Source0-md5: e34234db867202b035d48a77d1c78d82
URL: http://pyfakefs.org/
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%{?with_doc:BuildRequires: sphinx-pdg >= 1.0}
%if %{with python2}
BuildRequires: python-modules >= 1:2.7
-%{?with_tests:BuildRequires: python-pytest >= 2.8.6}
-%{?with_tests:BuildRequires: python-scandir}
BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-pathlib2 >= 2.3.2
+BuildRequires: python-pytest >= 2.8.6
+BuildRequires: python-scandir >= 1.8
+%endif
%endif
%if %{with python3}
-BuildRequires: python3-modules >= 1:3.3
-%{?with_tests:BuildRequires: python3-pytest >= 2.8.6}
+BuildRequires: python3-modules >= 1:3.4
BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pytest >= 2.8.6
+%if "%{py3_ver}" < "3.6"
+BuildRequires: python3-pathlib2 >= 2.3.2
+BuildRequires: python3-scandir >= 1.8
+%endif
+%endif
%endif
Requires: python-modules >= 1:2.7
BuildArch: noarch
@@ -52,7 +60,7 @@ aby działało z pyfakefs.
Summary: Fake file system that mocks the Python 3 file system modules
Summary(pl.UTF-8): Fałszywy system plików będący atrapą modułów systemowych Pythona 3 dla plików
Group: Libraries/Python
-Requires: python3-modules >= 1:3.3
+Requires: python3-modules >= 1:3.4
%description -n python3-pyfakefs
pyfakefs implements a fake file system that mocks the Python file
@@ -80,7 +88,6 @@ Dokumentacja API modułu Pythona pyfakefs.
%prep
%setup -q -n pyfakefs-%{version}
-%patch0 -p1
%build
export LC_ALL=C.UTF-8
@@ -89,11 +96,24 @@ export LC_ALL=C.UTF-8
%if %{with tests}
%{__python} -m pyfakefs.tests.all_tests
+# fails on pathlib
+#%{__python} -m pyfakefs.tests.all_tests_without_extra_packages
+
+PYTHONPATH=$(pwd) \
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pyfakefs.pytest_plugin \
+%{__python} -m pytest \
+ pyfakefs/pytest_tests/pytest_plugin_test.py
+# fails with python2 (any < 3.6?)
+#pyfakefs/pytest_tests/pytest_fixture_test.py
PYTHONPATH=$(pwd) \
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTEST_PLUGINS=pyfakefs.pytest_plugin \
-%{__python} -m pytest pyfakefs/tests/pytest_plugin_test.py
+%{__python} -m pytest \
+ pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || :
+%{__python} -m pytest \
+ pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py
%endif
%endif
@@ -102,10 +122,22 @@ PYTEST_PLUGINS=pyfakefs.pytest_plugin \
%if %{with tests}
%{__python3} -m pyfakefs.tests.all_tests
+%{__python3} -m pyfakefs.tests.all_tests_without_extra_packages
+
+PYTHONPATH=$(pwd) \
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pyfakefs.pytest_plugin \
+%{__python3} -m pytest \
+ pyfakefs/pytest_tests/pytest_fixture_test.py \
+ pyfakefs/pytest_tests/pytest_plugin_test.py
+
PYTHONPATH=$(pwd) \
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTEST_PLUGINS=pyfakefs.pytest_plugin \
-%{__python3} -m pytest pyfakefs/tests/pytest_plugin_test.py
+%{__python3} -m pytest \
+ pyfakefs/pytest_tests/pytest_plugin_failing_test.py > testresult.txt || :
+%{__python3} -m pytest \
+ pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py
%endif
%endif
diff --git a/python-pyfakefs-tests.patch b/python-pyfakefs-tests.patch
deleted file mode 100644
index cfde15a..0000000
--- a/python-pyfakefs-tests.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- pyfakefs-3.4.1/pyfakefs/tests/fake_os_test.py.orig 2018-03-18 08:35:26.000000000 +0100
-+++ pyfakefs-3.4.1/pyfakefs/tests/fake_os_test.py 2018-05-19 21:06:12.791205352 +0200
-@@ -964,7 +964,7 @@
-
- def test_append_mode_tell_linux_windows(self):
- self.check_linux_and_windows()
-- tell_result = 5 if self.is_python2 else 7
-+ tell_result = 5 if (self.is_python2 and not self.use_real_fs()) else 7
- self.check_append_mode_tell_after_truncate(tell_result)
-
- def test_append_mode_tell_macos(self):
-@@ -4113,6 +4113,8 @@
- def test_path_links_not_resolved(self):
- # regression test for #350
- self.skip_if_symlink_not_supported()
-+ if not hasattr(self.os, 'scandir'):
-+ raise unittest.SkipTest('os.scandir not found')
- dir_path = self.make_path('A', 'B', 'C')
- self.os.makedirs(self.os.path.join(dir_path, 'D'))
- link_path = self.make_path('A', 'C')
---- pyfakefs-3.4.1/pyfakefs/fake_filesystem_unittest.py.orig 2018-03-18 08:35:26.000000000 +0100
-+++ pyfakefs-3.4.1/pyfakefs/fake_filesystem_unittest.py 2018-05-20 20:39:45.228782238 +0200
-@@ -70,7 +70,7 @@
-
- try:
- import scandir # noqa: F401 import used to set has_scandir
-- import fake_scandir
-+ from pyfakefs import fake_scandir
- has_scandir = True
- except ImportError:
- has_scandir = False
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pyfakefs.git/commitdiff/937394ee6af1e4796e43430cf94ab7275de0adfa
More information about the pld-cvs-commit
mailing list