Merge pull request #4457 from nicoddemus/test-request-garbage

Try to fix/improve reporting of test_request_garbage
This commit is contained in:
Bruno Oliveira 2018-11-24 10:08:44 -02:00 committed by GitHub
commit 8facf1db90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 10 deletions

View File

@ -526,15 +526,8 @@ class TestRequestBasic(object):
try:
gc.collect()
leaked_types = sum(1 for _ in gc.garbage
if isinstance(_, PseudoFixtureDef))
# debug leaked types if the test fails
print(leaked_types)
gc.garbage[:] = []
assert leaked_types == 0
leaked = [x for _ in gc.garbage if isinstance(_, PseudoFixtureDef)]
assert leaked == []
finally:
gc.set_debug(original)
@ -542,7 +535,7 @@ class TestRequestBasic(object):
pass
"""
)
result = testdir.runpytest()
result = testdir.runpytest_subprocess()
result.stdout.fnmatch_lines("* 1 passed in *")
def test_getfixturevalue_recursive(self, testdir):