3 %bcond_without tests # py.test tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Thin-wrapper around the mock package for easier use with py.test
8 Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
9 Name: python-pytest-mock
13 Group: Libraries/Python
14 #Source0Download: https://pypi.org/simple/pytest-mock/
15 Source0: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
16 # Source0-md5: 54fb753faae3ad740ccd06c2d395045e
17 URL: https://pypi.org/project/pytest-mock/
19 BuildRequires: python-modules >= 1:2.7
20 BuildRequires: python-setuptools
21 BuildRequires: python-setuptools_scm
23 BuildRequires: python-mock
24 BuildRequires: python-pytest >= 2.7
28 BuildRequires: python3-modules >= 1:3.4
29 BuildRequires: python3-setuptools
30 BuildRequires: python3-setuptools_scm
32 BuildRequires: python3-pytest >= 2.7
33 # there is py3 test which relies on "mock" standalone module not being installed
34 BuildConflicts: python3-mock
37 BuildRequires: rpm-pythonprov
38 BuildRequires: rpmbuild(macros) >= 1.714
39 BuildRequires: sed >= 4.0
40 Requires: python-modules >= 1:2.7
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 This plugin installs a mocker fixture which is a thin-wrapper around
46 the patching API provided by the mock package, but with the benefit of
47 not having to worry about undoing patches at the end of a test.
49 %description -l pl.UTF-8
50 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
51 cienką warstwą ponad API dostarczane przez pakiet mock, ale
52 pozwalający nie martwić się o wycofywanie łat na końcu testu.
54 %package -n python3-pytest-mock
55 Summary: Thin-wrapper around the mock package for easier use with py.test
56 Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
57 Group: Libraries/Python
58 Requires: python3-modules >= 1:3.4
60 %description -n python3-pytest-mock
61 This plugin installs a mocker fixture which is a thin-wrapper around
62 the patching API provided by the mock package, but with the benefit of
63 not having to worry about undoing patches at the end of a test.
65 %description -n python3-pytest-mock -l pl.UTF-8
66 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
67 cienką warstwą ponad API dostarczane przez pakiet mock, ale
68 pozwalający nie martwić się o wycofywanie łat na końcu testu.
71 %setup -q -n pytest-mock-%{version}
78 PYTHONPATH=$(pwd) %{__python} -m pytest
86 PYTHONPATH=$(pwd) %{__python3} -m pytest
91 rm -rf $RPM_BUILD_ROOT
102 # avoid python3egg(mock) dependency (mock required only for python 2.x)
103 # (two different notations depending on setuptools version)
104 %{__sed} -i -e '/\[:python_version *< *"3.*\]/,/^mock$/d' \
105 -e '/^mock;python_version<"3\.0"/d' $RPM_BUILD_ROOT%{py3_sitescriptdir}/pytest_mock-%{version}-py*.egg-info/requires.txt
109 rm -rf $RPM_BUILD_ROOT
113 %defattr(644,root,root,755)
114 %doc CHANGELOG.rst LICENSE README.rst
115 %{py_sitescriptdir}/pytest_mock.py[co]
116 %{py_sitescriptdir}/_pytest_mock_version.py[co]
117 %{py_sitescriptdir}/pytest_mock-%{version}-py*.egg-info
121 %files -n python3-pytest-mock
122 %defattr(644,root,root,755)
123 %doc CHANGELOG.rst LICENSE README.rst
124 %{py3_sitescriptdir}/pytest_mock.py
125 %{py3_sitescriptdir}/_pytest_mock_version.py
126 %{py3_sitescriptdir}/__pycache__/pytest_mock.cpython-*.py[co]
127 %{py3_sitescriptdir}/__pycache__/_pytest_mock_version.cpython-*.py[co]
128 %{py3_sitescriptdir}/pytest_mock-%{version}-py*.egg-info