]> git.pld-linux.org Git - packages/python3-mock.git/blame - python3-mock.spec
- copied from python-mock.spec, updated to 4.0.3 (python 3.6+ now)
[packages/python3-mock.git] / python3-mock.spec
CommitLineData
8458ad63 1#
a9c81cc9 2# Conditional build:
0d282d8d 3%bcond_without doc # Sphinx documentation
8847a643 4%bcond_without tests # unit tests
a9c81cc9 5
deb91033 6%define module mock
8847a643
JB
7Summary: Rolling backport of unittest.mock for all Pythons
8Summary(pl.UTF-8): Podążający backport modułu unittest.mock dla wszystkich wersji Pythona
5bb8711c
JB
9Name: python3-%{module}
10Version: 4.0.3
8847a643
JB
11Release: 1
12License: BSD
abd23d0c 13Group: Development/Languages/Python
8847a643
JB
14##Source0Download: https://pypi.org/simple/mock/
15#Source0: https://files.pythonhosted.org/packages/source/m/mock/%{module}-%{version}.tar.gz
16# pypi dist misses docs and tests, use github archive
17#Source0Download: https://github.com/testing-cabal/mock/releases
18Source0: https://github.com/testing-cabal/mock/archive/%{version}/%{module}-%{version}.tar.gz
5bb8711c 19# Source0-md5: d2a1233e27b830742ad8f6999f3573c0
abd23d0c 20URL: http://python-mock.sourceforge.net/
5bb8711c 21BuildRequires: python3-modules >= 1:3.6
0d282d8d 22BuildRequires: python3-setuptools >= 17.1
8847a643
JB
23%if %{with tests}
24BuildRequires: python3-pytest
5515b7a0 25BuildRequires: python3-six >= 1.9
32e3a440 26%endif
8847a643
JB
27BuildRequires: rpm-pythonprov
28BuildRequires: rpmbuild(macros) >= 1.714
32e3a440 29%if %{with doc}
8847a643 30BuildRequires: python3-six >= 1.9
32e3a440
JB
31BuildRequires: sphinx-pdg-3
32%endif
5bb8711c 33Requires: python3-modules >= 1:3.6
abd23d0c 34BuildArch: noarch
35BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37%description
8bab2895
JB
38mock is a library for testing in Python. It allows you to replace
39parts of your system under test with mock objects and make assertions
40about how they have been used.
abd23d0c 41
8bab2895
JB
42mock provides a core `MagicMock` class removing the need to create a
43host of stubs throughout your test suite. After performing an action,
44you can make assertions about which methods/attributes were used and
45arguments they were called with. You can also specify return values
46and set needed attributes in the normal way.
abd23d0c 47
8bab2895 48The mock module also provides utility functions/objects to assist with
abd23d0c 49testing, particularly monkey patching.
50
8bab2895
JB
51%description -l pl.UTF-8
52mock to biblioteka do testowania w Pythonie. Pozwala na zastępowanie
53części testowanego systemu obiektami "mock" oraz sprawdzania zapewnień
54(assert) o tym, jak zostały użyte.
55
56mock udostępnia klasę główną "MagicMock", dzięki której nie trzeba
57tworzyć systemu zaślepek do testów. W czasie wykonywania akcji można
58kontrolować, czy odpowiednie metody/atrybuty zostały użyte i z jakimi
59argumentami. Można określić zwracane wartości i w zwykły sposób
60ustawiać potrzebne atrybuty.
61
8bab2895
JB
62Moduł mock udostępnia także funkcje/obiekty narzędziowe pomagające
63przy testowaniu, w szczególności łataniu.
64
8458ad63 65%package apidocs
0d282d8d
JB
66Summary: API documentation for mock module
67Summary(pl.UTF-8): Dokumentacja API modułu mock
8458ad63
ER
68Group: Documentation
69
70%description apidocs
0d282d8d 71API documentation for mock module.
8458ad63
ER
72
73%description apidocs -l pl.UTF-8
0d282d8d 74Dokumentacja API modułu mock.
a9c81cc9 75
abd23d0c 76%prep
77%setup -q -n %{module}-%{version}
78
79%build
8847a643
JB
80%py3_build
81
82%if %{with tests}
83# disable plugins (e.g. pytest-mock) to avoid changing assert output
84PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
85%{__python3} -m pytest mock/tests
86%endif
0d282d8d
JB
87
88%if %{with doc}
32e3a440 89PYTHONPATH=. sphinx-build-3 -b html docs html
a9c81cc9 90%endif
abd23d0c 91
92%install
93rm -rf $RPM_BUILD_ROOT
a9c81cc9 94
ec928db2 95%py3_install
abd23d0c 96
97%clean
98rm -rf $RPM_BUILD_ROOT
99
abd23d0c 100%files
101%defattr(644,root,root,755)
8847a643 102%doc CHANGELOG.rst LICENSE.txt README.rst
0d282d8d
JB
103%{py3_sitescriptdir}/mock
104%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
8458ad63
ER
105
106%if %{with doc}
107%files apidocs
108%defattr(644,root,root,755)
8847a643 109%doc html/{_static,*.html,*.js}
8458ad63 110%endif
This page took 0.050964 seconds and 4 git commands to generate.