Skip to content

Commit b3f8fab

Browse files
authored
Merge pull request #5308 from blueyed/minor
Minor fixes
2 parents 10ca84f + c081c01 commit b3f8fab

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/_pytest/fixtures.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,11 +853,9 @@ def finish(self, request):
853853
exceptions.append(sys.exc_info())
854854
if exceptions:
855855
e = exceptions[0]
856-
del (
857-
exceptions
858-
) # ensure we don't keep all frames alive because of the traceback
856+
# Ensure to not keep frame references through traceback.
857+
del exceptions
859858
six.reraise(*e)
860-
861859
finally:
862860
hook = self._fixturemanager.session.gethookproxy(request.node.fspath)
863861
hook.pytest_fixture_post_finalizer(fixturedef=self, request=request)

testing/test_pdb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def test_pdb_custom_cls_without_pdb(self, testdir, custom_pdb_calls):
817817
result.stdout.fnmatch_lines(["*NameError*xxx*", "*1 error*"])
818818
assert custom_pdb_calls == []
819819

820-
def test_pdb_custom_cls_with_settrace(self, testdir, monkeypatch):
820+
def test_pdb_custom_cls_with_set_trace(self, testdir, monkeypatch):
821821
testdir.makepyfile(
822822
custom_pdb="""
823823
class CustomPdb(object):
@@ -1133,14 +1133,14 @@ def test_pdbcls_via_local_module(testdir):
11331133
p1 = testdir.makepyfile(
11341134
"""
11351135
def test():
1136-
print("before_settrace")
1136+
print("before_set_trace")
11371137
__import__("pdb").set_trace()
11381138
""",
11391139
mypdb="""
11401140
class Wrapped:
11411141
class MyPdb:
11421142
def set_trace(self, *args):
1143-
print("settrace_called", args)
1143+
print("set_trace_called", args)
11441144
11451145
def runcall(self, *args, **kwds):
11461146
print("runcall_called", args, kwds)
@@ -1161,7 +1161,7 @@ def runcall(self, *args, **kwds):
11611161
str(p1), "--pdbcls=mypdb:Wrapped.MyPdb", syspathinsert=True
11621162
)
11631163
assert result.ret == 0
1164-
result.stdout.fnmatch_lines(["*settrace_called*", "* 1 passed in *"])
1164+
result.stdout.fnmatch_lines(["*set_trace_called*", "* 1 passed in *"])
11651165

11661166
# Ensure that it also works with --trace.
11671167
result = testdir.runpytest(

testing/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_one(): pass
171171
)
172172
try:
173173
reprec = testdir.inline_run(testdir.tmpdir)
174-
except pytest.skip.Exception: # pragma: no covers
174+
except pytest.skip.Exception: # pragma: no cover
175175
pytest.fail("wrong skipped caught")
176176
reports = reprec.getreports("pytest_collectreport")
177177
assert len(reports) == 1

0 commit comments

Comments
 (0)