|
|
8e0501 |
%bcond_without python3
|
|
|
8e0501 |
|
|
|
8e0501 |
%global pypi_name pytest-mock
|
|
|
8e0501 |
%global file_name pytest_mock
|
|
|
8e0501 |
%global desc This plugin installs a mocker fixture which is a thin-wrapper around the \
|
|
|
8e0501 |
patching API provided by the mock package, but with the benefit of not having \
|
|
|
8e0501 |
to worry about undoing patches at the end of a test.
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
Name: python-%{pypi_name}
|
|
|
8e0501 |
Version: 1.9.0
|
|
|
8e0501 |
Release: 4%{?dist}
|
|
|
8e0501 |
Summary: Thin-wrapper around the mock package for easier use with py.test
|
|
|
8e0501 |
|
|
|
8e0501 |
License: MIT
|
|
|
8e0501 |
URL: https://pypi.python.org/pypi/pytest-mock
|
|
|
8e0501 |
Source0: https://files.pythonhosted.org/packages/53/92/ed98ceca37fe779b4277382c7dd501936bac9d54bc3a19c32ae876701c81/pytest-mock-1.9.0.tar.gz
|
|
|
8e0501 |
BuildArch: noarch
|
|
|
8e0501 |
|
|
|
8e0501 |
%description
|
|
|
8e0501 |
%{desc}
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
%package -n python2-%{pypi_name}
|
|
|
8e0501 |
BuildArch: noarch
|
|
|
8e0501 |
BuildRequires: python2-devel
|
|
|
8e0501 |
BuildRequires: python2-pytest >= 2.7
|
|
|
8e0501 |
BuildRequires: python2-mock
|
|
|
8e0501 |
BuildRequires: python2-setuptools_scm
|
|
|
8e0501 |
Requires: python2-pytest >= 2.7
|
|
|
8e0501 |
Requires: python2-mock
|
|
|
8e0501 |
Summary: %{summary}
|
|
|
8e0501 |
%{?python_provide:%python_provide python2-%{pypi_name}}
|
|
|
8e0501 |
|
|
|
8e0501 |
%description -n python2-%{pypi_name}
|
|
|
8e0501 |
%{desc}
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
%if %{with python3}
|
|
|
8e0501 |
%package -n python3-%{pypi_name}
|
|
|
8e0501 |
Summary: %{summary}
|
|
|
8e0501 |
BuildArch: noarch
|
|
|
8e0501 |
BuildRequires: python3-devel
|
|
|
8e0501 |
BuildRequires: python3-pytest >= 2.7
|
|
|
8e0501 |
BuildRequires: python3-setuptools_scm
|
|
|
8e0501 |
Requires: python3-pytest >= 2.7
|
|
|
8e0501 |
%{?python_provide:%python_provide python3-%{pypi_name}}
|
|
|
8e0501 |
|
|
|
8e0501 |
%description -n python3-%{pypi_name}
|
|
|
8e0501 |
%{desc}
|
|
|
8e0501 |
|
|
|
8e0501 |
%endif
|
|
|
8e0501 |
|
|
|
8e0501 |
%prep
|
|
|
8e0501 |
%setup -qn %{pypi_name}-%{version}
|
|
|
8e0501 |
rm -rf *.egg-info
|
|
|
8e0501 |
|
|
|
8e0501 |
# Correct end of line encoding for README
|
|
|
8e0501 |
sed -i 's/\r$//' README.rst
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
%build
|
|
|
8e0501 |
%py2_build
|
|
|
8e0501 |
%if %{with python3}
|
|
|
8e0501 |
%py3_build
|
|
|
8e0501 |
%endif
|
|
|
8e0501 |
|
|
|
8e0501 |
%install
|
|
|
8e0501 |
%if %{with python3}
|
|
|
8e0501 |
%py3_install
|
|
|
8e0501 |
%endif
|
|
|
8e0501 |
%py2_install
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
%check
|
|
|
8e0501 |
PYTHONPATH="$(pwd)" py.test-%{python2_version} test_pytest_mock.py
|
|
|
8e0501 |
%if %{with python3}
|
|
|
8e0501 |
PYTHONPATH="$(pwd)" py.test-%{python3_version} test_pytest_mock.py
|
|
|
8e0501 |
%endif
|
|
|
8e0501 |
|
|
|
8e0501 |
%files -n python2-%{pypi_name}
|
|
|
8e0501 |
%doc README.rst
|
|
|
8e0501 |
%license LICENSE
|
|
|
8e0501 |
%{python2_sitelib}/%{file_name}-%{version}-py%{python2_version}.egg-info/
|
|
|
8e0501 |
%{python2_sitelib}/%{file_name}.py*
|
|
|
8e0501 |
%{python2_sitelib}/_pytest_mock_version.py*
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
%if %{with python3}
|
|
|
8e0501 |
%files -n python3-%{pypi_name}
|
|
|
8e0501 |
%doc README.rst
|
|
|
8e0501 |
%license LICENSE
|
|
|
8e0501 |
%{python3_sitelib}/%{file_name}-%{version}-py%{python3_version}.egg-info/
|
|
|
8e0501 |
%{python3_sitelib}/%{file_name}.py*
|
|
|
8e0501 |
%{python3_sitelib}/__pycache__/%{file_name}*.py*
|
|
|
8e0501 |
%{python3_sitelib}/_pytest_mock_version.py*
|
|
|
8e0501 |
%{python3_sitelib}/__pycache__/_pytest_mock_version.cpython*
|
|
|
8e0501 |
%endif
|
|
|
8e0501 |
|
|
|
8e0501 |
|
|
|
8e0501 |
%changelog
|
|
|
8e0501 |
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 1.9.0-4
|
|
|
8e0501 |
- Bumping due to problems with modular RPM upgrade path
|
|
|
8e0501 |
- Resolves: rhbz#1695587
|
|
|
8e0501 |
|
|
|
8e0501 |
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 1.9.0-2
|
|
|
8e0501 |
- Make possible to disable python3 subpackage
|
|
|
8e0501 |
|
|
|
8e0501 |
* Mon Jul 16 2018 Lumír Balhar <lbalhar@redhat.com> - 1.9.0-2
|
|
|
8e0501 |
- First version for python27 module
|