[packages/python-fixtures] - updated to 2.0.0 - added mock patch (on python 3.3+ use dist unittest.mock instead of external moc
qboosh
qboosh at pld-linux.org
Sat May 14 14:38:34 CEST 2016
commit 641b3e7ce990a1ebf18ff198d9d2e6c541bc1f7e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat May 14 14:38:40 2016 +0200
- updated to 2.0.0
- added mock patch (on python 3.3+ use dist unittest.mock instead of external mock)
python-fixtures-mock.patch | 14 ++++++++++++++
python-fixtures.spec | 23 +++++++++++++++++------
2 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/python-fixtures.spec b/python-fixtures.spec
index 811aaa3..042a3bd 100644
--- a/python-fixtures.spec
+++ b/python-fixtures.spec
@@ -1,19 +1,20 @@
#
# Conditional build:
-%bcond_with tests # test target [as of 1.4.0 test_warnings fails in some cases]
+%bcond_without tests # test target
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
Summary: Fixtures, reusable state for writing clean tests and more
Summary(pl.UTF-8): Wyposażenie testów - stan wielokrotnego użytku pozwalający na pisanie czystych testów
Name: python-fixtures
-Version: 1.4.0
+Version: 2.0.0
Release: 1
License: Apache v2.0 or BSD
Group: Libraries/Python
#Source0Download: https://pypi.python.org/simple/fixtures/
Source0: https://pypi.python.org/packages/source/f/fixtures/fixtures-%{version}.tar.gz
-# Source0-md5: b706476cb754c9587e7308f9eb18e201
+# Source0-md5: 146d706c1f211a5ca3be6de2d0850889
+Patch0: %{name}-mock.patch
URL: https://pypi.python.org/pypi/fixtures
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
@@ -24,16 +25,17 @@ BuildRequires: python-setuptools
%if %{with tests}
BuildRequires: python-mock
BuildRequires: python-six
+BuildRequires: python-testrepository
BuildRequires: python-testtools >= 0.9.22
%endif
%endif
%if %{with python3}
-BuildRequires: python3-modules >= 1:3.2
+BuildRequires: python3-modules >= 1:3.3
BuildRequires: python3-pbr >= 0.11
BuildRequires: python3-setuptools
%if %{with tests}
-BuildRequires: python3-mock
BuildRequires: python3-six
+BuildRequires: python3-testrepository
BuildRequires: python3-testtools >= 0.9.22
%endif
%endif
@@ -68,7 +70,7 @@ przypadkach testowych zgodnych z modułem unittest.
Summary: Fixtures, reusable state for writing clean tests and more
Summary(pl.UTF-8): Wyposażenie testów - stan wielokrotnego użytku pozwalający na pisanie czystych testów
Group: Libraries/Python
-Requires: python3-modules >= 1:3.2
+Requires: python3-modules >= 1:3.3
Requires: python3-six
Requires: python3-testtools >= 0.9.22
@@ -90,14 +92,23 @@ przypadkach testowych zgodnych z modułem unittest.
%prep
%setup -q -n fixtures-%{version}
+%patch0 -p1
%build
%if %{with python2}
+# export for tests
+export PYTHON=%{__python}
%py_build %{?with_tests:test}
+
+%{?with_tests:%{__rm} -r .testrepository}
%endif
%if %{with python3}
+# export for tests
+export PYTHON=%{__python3}
%py3_build %{?with_tests:test}
+
+%{?with_tests:%{__rm} -r .testrepository}
%endif
%install
diff --git a/python-fixtures-mock.patch b/python-fixtures-mock.patch
new file mode 100644
index 0000000..ac13c9a
--- /dev/null
+++ b/python-fixtures-mock.patch
@@ -0,0 +1,14 @@
+--- fixtures-2.0.0/fixtures/tests/_fixtures/test_mockpatch.py.orig 2016-03-23 23:55:38.000000000 +0100
++++ fixtures-2.0.0/fixtures/tests/_fixtures/test_mockpatch.py 2016-05-14 14:14:25.983741571 +0200
+@@ -14,7 +14,10 @@
+
+
+ import extras
+-import mock # Yes, we only test the rolling backport
++try:
++ from unittest import mock
++except:
++ import mock
+ import testtools
+
+ from fixtures import (
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-fixtures.git/commitdiff/641b3e7ce990a1ebf18ff198d9d2e6c541bc1f7e
More information about the pld-cvs-commit
mailing list