diff --git a/0001-modify-test-cases-for-python3.8.patch b/0001-modify-test-cases-for-python3.8.patch new file mode 100644 index 0000000000000000000000000000000000000000..814b9f0d5023840fc0f839a3434cfb266eca6680 --- /dev/null +++ b/0001-modify-test-cases-for-python3.8.patch @@ -0,0 +1,37 @@ +From ed9daac30fb2a6c9e4f32bdbab6907012d96980d Mon Sep 17 00:00:00 2001 +From: lizhenhua +Date: Wed, 24 Jun 2020 16:34:29 +0800 +Subject: [PATCH] modify test cases for python3.8 + +--- + test_pytest_mock.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/test_pytest_mock.py b/test_pytest_mock.py +index d9a4faf..1fb2574 100644 +--- a/test_pytest_mock.py ++++ b/test_pytest_mock.py +@@ -179,7 +179,7 @@ class TestMockerStub: + + def __test_failure_message(self, mocker, **kwargs): + expected_name = kwargs.get('name') or 'mock' +- expected_message = 'Expected call: {0}()\nNot called'.format(expected_name) ++ expected_message = 'expected call not found.\nExpected: {0}()\nActual: not called.'.format(expected_name) + stub = mocker.stub(**kwargs) + with pytest.raises(AssertionError) as exc_info: + stub.assert_called_with() +@@ -560,8 +560,9 @@ def test_detailed_introspection(testdir): + """) + result = testdir.runpytest('-s') + result.stdout.fnmatch_lines([ +- "*AssertionError: Expected call: mock('', bar=4)*", +- "*Actual call: mock('fo')*", ++ "*AssertionError: expected call not found.", ++ "*Expected: mock('', bar=4)", ++ "*Actual: mock('fo')", + "*pytest introspection follows:*", + '*Args:', + "*assert ('fo',) == ('',)", +-- +2.23.0 + diff --git a/python-pytest-mock.spec b/python-pytest-mock.spec index b6f108a574fb56b09c4c7a4fcf5e104248d69f9b..1459db4ac479485a4909a754f60cb43075a088db 100644 --- a/python-pytest-mock.spec +++ b/python-pytest-mock.spec @@ -1,10 +1,11 @@ Name: python-pytest-mock Version: 1.10.0 -Release: 4 +Release: 5 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/source/p/pytest-mock/pytest-mock-%{version}.tar.gz +Patch0000: 0001-modify-test-cases-for-python3.8.patch BuildArch: noarch %description @@ -74,5 +75,8 @@ PYTHONPATH="$(pwd)" py.test-%{python3_version} test_pytest_mock.py %{python3_sitelib}/__pycache__/* %changelog +* Wed Jun 24 2020 lizhenhua - 1.10.0-5 +- Modify test cases for python3.8 + * Wed Jan 08 2019 yangjian - 1.10.0-4 - Package init