Merge pull request #3452 from nicoddemus/fix-flaky-xdist-test
Attempt to fix flaky test on Python 2
This commit is contained in:
commit
84b37e1b57
|
@ -523,6 +523,7 @@ class TestRequestBasic(object):
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
import sys
|
import sys
|
||||||
import pytest
|
import pytest
|
||||||
|
from _pytest.compat import safe_str
|
||||||
import gc
|
import gc
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
|
@ -539,7 +540,7 @@ class TestRequestBasic(object):
|
||||||
|
|
||||||
gc.collect()
|
gc.collect()
|
||||||
leaked_types = sum(1 for _ in gc.garbage
|
leaked_types = sum(1 for _ in gc.garbage
|
||||||
if 'PseudoFixtureDef' in str(_))
|
if 'PseudoFixtureDef' in safe_str(_))
|
||||||
|
|
||||||
gc.garbage[:] = []
|
gc.garbage[:] = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue