RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-pytest-mock#82bc63008efdbcb6dca4b68127f95e5766038f17
This commit is contained in:
Troy Dawson 2020-10-14 20:00:26 -07:00
parent 1291c3a7a4
commit 00c1fd319c
6 changed files with 290 additions and 0 deletions

16
.gitignore vendored
View File

@ -0,0 +1,16 @@
/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
/pytest-mock-1.10.0.tar.gz
/pytest-mock-1.10.1.tar.gz
/pytest-mock-1.10.2.tar.gz
/pytest-mock-1.10.3.tar.gz
/pytest-mock-1.10.4.tar.gz
/pytest-mock-3.2.0.tar.gz
/pytest-mock-3.3.0.tar.gz
/pytest-mock-3.3.1.tar.gz

View File

@ -0,0 +1,46 @@
From 970e4b1f8cfd6bd750b4c8240efad378cbf049c2 Mon Sep 17 00:00:00 2001
From: Bruno Oliveira <nicoddemus@gmail.com>
Date: Mon, 1 Jul 2019 19:31:36 -0300
Subject: [PATCH] Fix tests expectations with latest pytest
Fix #149
---
test_pytest_mock.py | 2 +-
tox.ini | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test_pytest_mock.py b/test_pytest_mock.py
index 562ff0c..cdc04fe 100644
--- a/test_pytest_mock.py
+++ b/test_pytest_mock.py
@@ -639,7 +639,7 @@ def test(mocker):
"*Use -v to get the full diff*",
"*Kwargs:*",
"*assert {} == {'bar': 4}*",
- "*Right contains more items:*",
+ "*Right contains* more item*",
"*{'bar': 4}*",
"*Use -v to get the full diff*",
]
diff --git a/tox.ini b/tox.ini
index 427b25f..98117bf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,7 @@ commands =
[testenv:norewrite]
commands =
- pytest test_pytest_mock.py --assert=plain -ra
+ pytest test_pytest_mock.py --assert=plain
[testenv:linting]
skipsdist = True
@@ -20,7 +20,7 @@ basepython = python3.6
commands = pre-commit run --all-files --show-diff-on-failure
[pytest]
-addopts = -ra
+addopts = -r a
[flake8]
max-line-length = 88

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")

46
fix-mock-python-3.8.patch Normal file
View File

@ -0,0 +1,46 @@
From b2683fdfc2fbd67dfc14bfc8e9d2c06530975397 Mon Sep 17 00:00:00 2001
From: Bruno Oliveira <bruno@esss.com.br>
Date: Fri, 3 May 2019 08:58:31 -0300
Subject: [PATCH] Fix tests due to new formatting in mock 3.0 and python 3.8
---
test_pytest_mock.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test_pytest_mock.py b/test_pytest_mock.py
index 7bc38cb..562ff0c 100644
--- a/test_pytest_mock.py
+++ b/test_pytest_mock.py
@@ -10,11 +10,11 @@
# could not make some of the tests work on PyPy, patches are welcome!
skip_pypy = pytest.mark.skipif(
- platform.python_implementation() == "PyPy", reason="could not make work on pypy"
+ platform.python_implementation() == "PyPy", reason="could not make it work on pypy"
)
-# Python 3.8 changed the output formatting (bpo-35500).
-PY38 = sys.version_info >= (3, 8)
+# Python 3.8 changed the output formatting (bpo-35500), which has been ported to mock 3.0
+NEW_FORMATTING = sys.version_info >= (3, 8) or sys.version_info[0] == 2
@pytest.fixture
@@ -209,7 +209,7 @@ def test_repr_with_name(self, mocker):
def __test_failure_message(self, mocker, **kwargs):
expected_name = kwargs.get("name") or "mock"
- if PY38:
+ if NEW_FORMATTING:
msg = "expected call not found.\nExpected: {0}()\nActual: not called."
else:
msg = "Expected call: {0}()\nNot called"
@@ -620,7 +620,7 @@ def test(mocker):
"""
)
result = testdir.runpytest("-s")
- if PY38:
+ if NEW_FORMATTING:
expected_lines = [
"*AssertionError: expected call not found.",
"*Expected: mock('', bar=4)",

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

@ -0,0 +1,160 @@
%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: 3.3.1
Release: 1%{?dist}
Summary: Thin-wrapper around the mock package for easier use with py.test
License: MIT
URL: https://github.com/pytest-dev/pytest-mock/
Source0: %{pypi_source}
BuildArch: noarch
%description
%{desc}
%package -n python3-%{pypi_name}
Summary: %{summary}
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-setuptools_scm
BuildRequires: python3-pytest-asyncio
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
%{desc}
%prep
%autosetup -n %{pypi_name}-%{version} -p1
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=%{buildroot}%{python3_sitelib} pytest-%{python3_version} -v tests \
-k "not test_standalone_mock and not test_detailed_introspection and not test_detailed_introspection \
and not test_assert_called_args_with_introspection and not test_assert_called_kwargs_with_introspection"
%files -n python3-%{pypi_name}
%doc CHANGELOG.rst README.rst
%license LICENSE
%{python3_sitelib}/%{file_name}/
%{python3_sitelib}/%{file_name}-%{version}-py%{python3_version}.egg-info/
%changelog
* Sat Aug 29 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.3.1-1
- Update to latest upstream release 3.3.1 (rhbz#1871290)
* Fri Aug 21 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.3.0-1
- Update to latest upstream release 3.3.0 (rhbz#1871290)
* Fri Aug 21 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.2.0-1
- Update to latest upstream release 3.2.0 (rhbz#1756646)
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri May 29 2020 Miro Hrončok <mhroncok@redhat.com> - 1.10.4-9
- Drop manual requires on python3-pytest to support usage with pytest4 compat package
* Sun May 24 2020 Miro Hrončok <mhroncok@redhat.com> - 1.10.4-8
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Oct 01 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.4-6
- Subpackage python2-pytest-mock has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Aug 17 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.4-5
- Rebuilt for Python 3.8
* Thu Aug 01 2019 Julien Enselme <jujens@jujens.eu> - 1.10.4-4
- Fix build issues with python 3.8 and mock 3.0
* Tue Jul 30 2019 Julien Enselme <jujens@jujens.eu> - 1.10.4-3
- Fix build issues with pytest 4.6.3
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Jul 13 2019 Julien Enselme <jujens@jujens.eu> - 1.10.4-1
- Update to 1.10.4
* Thu Apr 04 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.3-1
- Update to 1.10.3
* Sat Feb 23 2019 Julien Enselme <jujens@jujens.eu> - 1.10.1-1
- Update to 1.10.1
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.10.0-2
- Rebuilt for Python 3.7
* Mon May 07 2018 Julien Enselme <jujens@jujens.eu> - 1.10.0-1
- Update to 1.10.0
* 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-3.3.1.tar.gz) = ffd53974f82f725cf3bdbe750c1deb568ad1a12a67532eca93ff28d80b1cbcd8ebf709985f5473717c9d54345b251c1627c0567821e9e8b9e102db5c16cf7421