Skip to content

Commit

Permalink
Merge pull request #5308 from blueyed/minor
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
asottile authored May 26, 2019
2 parents 10ca84f + c081c01 commit b3f8fab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,11 +853,9 @@ def finish(self, request):
exceptions.append(sys.exc_info())
if exceptions:
e = exceptions[0]
del (
exceptions
) # ensure we don't keep all frames alive because of the traceback
# Ensure to not keep frame references through traceback.
del exceptions
six.reraise(*e)

finally:
hook = self._fixturemanager.session.gethookproxy(request.node.fspath)
hook.pytest_fixture_post_finalizer(fixturedef=self, request=request)
Expand Down
8 changes: 4 additions & 4 deletions testing/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def test_pdb_custom_cls_without_pdb(self, testdir, custom_pdb_calls):
result.stdout.fnmatch_lines(["*NameError*xxx*", "*1 error*"])
assert custom_pdb_calls == []

def test_pdb_custom_cls_with_settrace(self, testdir, monkeypatch):
def test_pdb_custom_cls_with_set_trace(self, testdir, monkeypatch):
testdir.makepyfile(
custom_pdb="""
class CustomPdb(object):
Expand Down Expand Up @@ -1133,14 +1133,14 @@ def test_pdbcls_via_local_module(testdir):
p1 = testdir.makepyfile(
"""
def test():
print("before_settrace")
print("before_set_trace")
__import__("pdb").set_trace()
""",
mypdb="""
class Wrapped:
class MyPdb:
def set_trace(self, *args):
print("settrace_called", args)
print("set_trace_called", args)
def runcall(self, *args, **kwds):
print("runcall_called", args, kwds)
Expand All @@ -1161,7 +1161,7 @@ def runcall(self, *args, **kwds):
str(p1), "--pdbcls=mypdb:Wrapped.MyPdb", syspathinsert=True
)
assert result.ret == 0
result.stdout.fnmatch_lines(["*settrace_called*", "* 1 passed in *"])
result.stdout.fnmatch_lines(["*set_trace_called*", "* 1 passed in *"])

# Ensure that it also works with --trace.
result = testdir.runpytest(
Expand Down
2 changes: 1 addition & 1 deletion testing/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_one(): pass
)
try:
reprec = testdir.inline_run(testdir.tmpdir)
except pytest.skip.Exception: # pragma: no covers
except pytest.skip.Exception: # pragma: no cover
pytest.fail("wrong skipped caught")
reports = reprec.getreports("pytest_collectreport")
assert len(reports) == 1
Expand Down

0 comments on commit b3f8fab

Please sign in to comment.