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