Compare commits

..

No commits in common. "c8s-stream-2.7" and "c8s" have entirely different histories.

6 changed files with 146 additions and 112 deletions

9
.gitignore vendored
View File

@ -1 +1,8 @@
SOURCES/pytest-mock-1.9.0.tar.gz
/pytest-mock-1.1.zip
/pytest-mock-1.2.zip
/pytest-mock-1.6.0.tar.gz
/pytest-mock-1.6.2.tar.gz
/pytest-mock-1.6.3.tar.gz
/pytest-mock-1.7.0.tar.gz
/pytest-mock-1.7.1.tar.gz
/pytest-mock-1.9.0.tar.gz

View File

@ -1 +0,0 @@
59baa0f036a4d81300199c5400d54274a23d6b49 SOURCES/pytest-mock-1.9.0.tar.gz

View File

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

21
fix-for-pytest3.patch Normal file
View File

@ -0,0 +1,21 @@
diff --git a/test_pytest_mock.py b/test_pytest_mock.py
index 1e47d0e..e54649a 100644
--- a/test_pytest_mock.py
+++ b/test_pytest_mock.py
@@ -176,7 +176,7 @@ def __test_failure_message(self, mocker, **kwargs):
stub = mocker.stub(**kwargs)
with pytest.raises(AssertionError) as exc_info:
stub.assert_called_with()
- assert exc_info.value.msg == expected_message
+ assert str(exc_info.value) == expected_message
def test_failure_message_with_no_name(self, mocker):
self.__test_failure_message(mocker)
@@ -352,7 +352,7 @@ def assert_argument_introspection(left, right):
# test was run by examining sys.argv
verbose = any(a.startswith('-v') for a in sys.argv)
expected = '\n '.join(util._compare_eq_iterable(left, right, verbose))
- assert expected in e.msg
+ assert expected in str(e)
else:
raise AssertionError("DID NOT RAISE")

116
python-pytest-mock.spec Normal file
View File

@ -0,0 +1,116 @@
%global pypi_name pytest-mock
%global file_name pytest_mock
%global desc This plugin installs a mocker fixture which is a thin-wrapper around the \
patching API provided by the mock package, but with the benefit of not having \
to worry about undoing patches at the end of a test.
Name: python-%{pypi_name}
Version: 1.9.0
Release: 2%{?dist}
Summary: Thin-wrapper around the mock package for easier use with py.test
License: MIT
URL: https://pypi.python.org/pypi/pytest-mock
Source0: https://files.pythonhosted.org/packages/53/92/ed98ceca37fe779b4277382c7dd501936bac9d54bc3a19c32ae876701c81/pytest-mock-1.9.0.tar.gz
BuildArch: noarch
%description
%{desc}
%package -n python3-%{pypi_name}
Summary: %{summary}
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pytest >= 2.7
BuildRequires: python3-setuptools_scm
Requires: python3-pytest >= 2.7
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
%{desc}
%prep
%setup -qn %{pypi_name}-%{version}
rm -rf *.egg-info
# Correct end of line encoding for README
sed -i 's/\r$//' README.rst
%build
%py3_build
%install
%py3_install
%check
PYTHONPATH="$(pwd)" %{__python3} -m pytest test_pytest_mock.py
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{file_name}-%{version}-py%{python3_version}.egg-info/
%{python3_sitelib}/%{file_name}.py*
%{python3_sitelib}/__pycache__/%{file_name}*.py*
%{python3_sitelib}/_pytest_mock_version.py*
%{python3_sitelib}/__pycache__/_pytest_mock_version.cpython*
%changelog
* Wed Jul 11 2018 Petr Viktorin <pviktori@redhat.com> - 1.9.0-2
- Remove the Python 2 subpackage
https://bugzilla.redhat.com/show_bug.cgi?id=1590403
* Sun Apr 15 2018 Julien Enselme <jujens@jujens.eu> - 1.9.0-1
- Update to 1.9.0
* Thu Mar 01 2018 Julien Enselme <jujens@jujens.eu> - 1.7.1-1
- Update to 1.7.1
* Mon Feb 19 2018 Julien Enselme <jujens@jujesn.eu> - 1.7.0-1
- Update to 1.7.0
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Sep 16 2017 Julien Enselme <jujens@jujens.eu> - 1.6.3-1
- Update to 1.6.3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sun Jul 23 2017 Julien Enselme <jujens@jujens.eu> - 1.6.2-1
- Update to 1.6.2
* Wed Apr 05 2017 Julien Enselme <jujens@jujens.eu> - 1.6.0-2
- Add missing BR
* Wed Apr 05 2017 Julien Enselme <jujens@jujens.eu> - 1.6.0-1
- Update to 1.6.0
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.2-3
- Rebuild for Python 3.6
* Sat Oct 01 2016 Julien Enselme <jujens@jujens.eu> - 1.2-2
- Add patch to fix tests with pytest3
* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 1.2-1
- Update to 1.2
* Wed Aug 31 2016 Julien Enselme <jujens@jujens.eu> - 1.1-3
- Use %%summary instead of custom %%sum macro
* Mon Aug 29 2016 Julien Enselme <jujens@jujens.eu> - 1.1-2
- Add python2-mock to BR so %%check passes correctly.
* Tue Jul 26 2016 Julien Enselme <jujens@jujens.eu> - 1.1-1
- Inital package

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (pytest-mock-1.9.0.tar.gz) = b3e2d2cf9229d170ee5d9d636aaf9aa663baf02fdd38ac1bbffc6d9b5835f7be70152ffc8aa36fd1fc62ee533a9310c0951bc961a74b4618b58937c2d26176d6