File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 10
10
11
11
# could not make some of the tests work on PyPy, patches are welcome!
12
12
skip_pypy = pytest .mark .skipif (
13
- platform .python_implementation () == "PyPy" , reason = "could not make work on pypy"
13
+ platform .python_implementation () == "PyPy" , reason = "could not make it work on pypy"
14
14
)
15
15
16
- # Python 3.8 changed the output formatting (bpo-35500).
17
- PY38 = sys .version_info >= (3 , 8 )
16
+ # Python 3.8 changed the output formatting (bpo-35500), which has been ported to mock 3.0
17
+ NEW_FORMATTING = sys .version_info >= (3 , 8 ) or sys . version_info [ 0 ] == 2
18
18
19
19
20
20
@pytest .fixture
@@ -209,7 +209,7 @@ def test_repr_with_name(self, mocker):
209
209
210
210
def __test_failure_message (self , mocker , ** kwargs ):
211
211
expected_name = kwargs .get ("name" ) or "mock"
212
- if PY38 :
212
+ if NEW_FORMATTING :
213
213
msg = "expected call not found.\n Expected: {0}()\n Actual: not called."
214
214
else :
215
215
msg = "Expected call: {0}()\n Not called"
@@ -620,7 +620,7 @@ def test(mocker):
620
620
"""
621
621
)
622
622
result = testdir .runpytest ("-s" )
623
- if PY38 :
623
+ if NEW_FORMATTING :
624
624
expected_lines = [
625
625
"*AssertionError: expected call not found." ,
626
626
"*Expected: mock('', bar=4)" ,
You can’t perform that action at this time.
0 commit comments