1 # NOTE: for versions >= 3 see python3-pytest-mock.spec
4 %bcond_without tests # py.test tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_with python3 # CPython 3.x module (built from python3-pytest-mock.spec)
8 Summary: Thin-wrapper around the mock package for easier use with py.test
9 Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
10 Name: python-pytest-mock
11 # keep 2.x here for python2 support
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/pytest-mock/
17 Source0: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
18 # Source0-md5: b6bcfb98b922b666d9a0db21a38f9d8a
19 URL: https://pypi.org/project/pytest-mock/
21 BuildRequires: python-modules >= 1:2.7
22 BuildRequires: python-setuptools
23 BuildRequires: python-setuptools_scm
25 BuildRequires: python-mock
26 BuildRequires: python-pytest >= 2.7
30 BuildRequires: python3-modules >= 1:3.4
31 BuildRequires: python3-setuptools
32 BuildRequires: python3-setuptools_scm
34 BuildRequires: python3-pytest >= 2.7
35 # there is py3 test which relies on "mock" standalone module not being installed
36 BuildConflicts: python3-mock
39 BuildRequires: rpm-pythonprov
40 BuildRequires: rpmbuild(macros) >= 1.714
41 BuildRequires: sed >= 4.0
42 Requires: python-modules >= 1:2.7
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 This plugin installs a mocker fixture which is a thin-wrapper around
48 the patching API provided by the mock package, but with the benefit of
49 not having to worry about undoing patches at the end of a test.
51 %description -l pl.UTF-8
52 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
53 cienką warstwą ponad API dostarczane przez pakiet mock, ale
54 pozwalający nie martwić się o wycofywanie łat na końcu testu.
56 %package -n python3-pytest-mock
57 Summary: Thin-wrapper around the mock package for easier use with py.test
58 Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
59 Group: Libraries/Python
60 Requires: python3-modules >= 1:3.4
62 %description -n python3-pytest-mock
63 This plugin installs a mocker fixture which is a thin-wrapper around
64 the patching API provided by the mock package, but with the benefit of
65 not having to worry about undoing patches at the end of a test.
67 %description -n python3-pytest-mock -l pl.UTF-8
68 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
69 cienką warstwą ponad API dostarczane przez pakiet mock, ale
70 pozwalający nie martwić się o wycofywanie łat na końcu testu.
73 %setup -q -n pytest-mock-%{version}
80 PYTHONPATH=$(pwd)/src \
81 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
82 PYTEST_PLUGINS="pytest_mock" \
83 %{__python} -m pytest tests
91 PYTHONPATH=$(pwd)/src \
92 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
93 PYTEST_PLUGINS="pytest_mock" \
94 %{__python3} -m pytest tests
99 rm -rf $RPM_BUILD_ROOT
112 rm -rf $RPM_BUILD_ROOT
116 %defattr(644,root,root,755)
117 %doc CHANGELOG.rst LICENSE README.rst
118 %{py_sitescriptdir}/pytest_mock
119 %{py_sitescriptdir}/pytest_mock-%{version}-py*.egg-info
123 %files -n python3-pytest-mock
124 %defattr(644,root,root,755)
125 %doc CHANGELOG.rst LICENSE README.rst
126 %{py3_sitescriptdir}/pytest_mock
127 %{py3_sitescriptdir}/pytest_mock-%{version}-py*.egg-info