]>
Commit | Line | Data |
---|---|---|
bd3d8e27 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # py.test tests | |
4 | ||
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 | |
0a882d41 | 8 | Version: 3.7.0 |
cca9553f | 9 | Release: 3 |
bd3d8e27 JB |
10 | License: MIT |
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 | |
0a882d41 | 14 | # Source0-md5: 8a17273e0dd1edd32b9c01e876a824fd |
bd3d8e27 | 15 | URL: https://pypi.org/project/pytest-mock/ |
0a882d41 | 16 | BuildRequires: python3-modules >= 1:3.7 |
bd3d8e27 JB |
17 | BuildRequires: python3-setuptools |
18 | BuildRequires: python3-setuptools_scm | |
19 | %if %{with tests} | |
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 | |
24 | %endif | |
25 | BuildRequires: rpm-pythonprov | |
26 | BuildRequires: rpmbuild(macros) >= 1.714 | |
0a882d41 | 27 | Requires: python3-modules >= 1:3.7 |
bd3d8e27 JB |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
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. | |
35 | ||
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. | |
40 | ||
41 | %prep | |
42 | %setup -q -n pytest-mock-%{version} | |
43 | ||
44 | %build | |
45 | %py3_build | |
46 | ||
47 | %if %{with tests} | |
48 | PYTHONPATH=$(pwd)/src \ | |
49 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
50 | PYTEST_PLUGINS="pytest_asyncio.plugin,pytest_mock" \ | |
51 | %{__python3} -m pytest tests | |
52 | %endif | |
53 | ||
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | ||
57 | %py3_install | |
58 | ||
59 | %clean | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
62 | %files | |
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 |