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