3 %bcond_without tests # py.test tests
5 Summary: Thin-wrapper around the mock package for easier use with py.test
6 Summary(pl.UTF-8): Cienka warstwa obudowująca pakiet mock, ułatwiająca używanie wraz z py.test
7 Name: python3-pytest-mock
11 Group: Libraries/Python
12 #Source0Download: https://pypi.org/simple/pytest-mock/
13 Source0: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
14 # Source0-md5: 8a17273e0dd1edd32b9c01e876a824fd
15 URL: https://pypi.org/project/pytest-mock/
16 BuildRequires: python3-modules >= 1:3.7
17 BuildRequires: python3-setuptools
18 BuildRequires: python3-setuptools_scm
20 BuildRequires: python3-pytest >= 5.0
21 BuildRequires: python3-pytest-asyncio
22 # there is py3 test which relies on "mock" standalone module not being installed
23 BuildConflicts: python3-mock
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.714
27 Requires: python3-modules >= 1:3.7
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 This plugin installs a mocker fixture which is a thin-wrapper around
33 the patching API provided by the mock package, but with the benefit of
34 not having to worry about undoing patches at the end of a test.
36 %description -l pl.UTF-8
37 Ta wtyczka instaluje osprzęt (fixture) do tworzenia atrap, będący
38 cienką warstwą ponad API dostarczane przez pakiet mock, ale
39 pozwalający nie martwić się o wycofywanie łat na końcu testu.
42 %setup -q -n pytest-mock-%{version}
48 PYTHONPATH=$(pwd)/src \
49 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
50 PYTEST_PLUGINS="pytest_asyncio.plugin,pytest_mock" \
51 %{__python3} -m pytest tests
55 rm -rf $RPM_BUILD_ROOT
60 rm -rf $RPM_BUILD_ROOT
63 %defattr(644,root,root,755)
64 %doc CHANGELOG.rst LICENSE README.rst
65 %{py3_sitescriptdir}/pytest_mock
66 %{py3_sitescriptdir}/pytest_mock-%{version}-py*.egg-info