- Remove mock30.patch for now as we are not able to upgrade
to mock3 yet OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-mock?expand=0&rev=12
This commit is contained in:
parent
5c4df46496
commit
32a128e74c
46
mock30.patch
46
mock30.patch
@ -1,46 +0,0 @@
|
|||||||
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)",
|
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jul 26 12:26:36 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
- Remove mock30.patch for now as we are not able to upgrade
|
||||||
|
to mock3 yet
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jul 18 08:52:38 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
|
Thu Jul 18 08:52:38 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ License: MIT
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/pytest-dev/pytest-mock
|
URL: https://github.com/pytest-dev/pytest-mock
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz
|
||||||
Patch0: mock30.patch
|
|
||||||
Patch1: fix_tests.patch
|
Patch1: fix_tests.patch
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools >= 36}
|
BuildRequires: %{python_module setuptools >= 36}
|
||||||
|
Loading…
Reference in New Issue
Block a user