Skip to content

Commit 4de0aa6

Browse files
committed
Minor improvements and fix linting
1 parent 6dcbf84 commit 4de0aa6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/_pytest/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def execute(self, request):
895895
if cached_result is not None:
896896
result, cache_key, err = cached_result
897897
# note: comparison with `==` can fail (or be expensive) for e.g.
898-
# numpy arrays
898+
# numpy arrays (#6497)
899899
if my_cache_key is cache_key:
900900
if err is not None:
901901
_, val, tb = err

testing/python/fixtures.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,15 +1109,14 @@ def test_parameters_without_eq_semantics(self, scope, testdir):
11091109
class NoEq1: # fails on `a == b` statement
11101110
def __eq__(self, _):
11111111
raise RuntimeError
1112-
1112+
11131113
class NoEq2: # fails on `if a == b:` statement
11141114
def __eq__(self, _):
11151115
class NoBool:
11161116
def __bool__(self):
11171117
raise RuntimeError
1118-
__nonzero__ = __bool__ # for Py2
11191118
return NoBool()
1120-
1119+
11211120
import pytest
11221121
@pytest.fixture(params=[NoEq1(), NoEq2()], scope={scope!r})
11231122
def no_eq(request):
@@ -1128,7 +1127,9 @@ def test1(no_eq):
11281127
11291128
def test2(no_eq):
11301129
pass
1131-
""".format(scope=scope)
1130+
""".format(
1131+
scope=scope
1132+
)
11321133
)
11331134
result = testdir.runpytest()
11341135
result.stdout.fnmatch_lines(["*4 passed*"])

0 commit comments

Comments
 (0)