From 5ea647a24586aab7e21fb39d8046dedfa1bc0310 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 10 Jun 2018 19:13:57 -0300 Subject: [PATCH] Attempt to fix flaky test_request_garbage on Windows Fix #3564 --- testing/python/fixture.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index 023a40d84..6d2bb663b 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -630,7 +630,7 @@ class TestRequestBasic(object): """ import sys import pytest - from _pytest.compat import safe_str + from _pytest.fixtures import PseudoFixtureDef import gc @pytest.fixture(autouse=True) @@ -647,7 +647,7 @@ class TestRequestBasic(object): gc.collect() leaked_types = sum(1 for _ in gc.garbage - if 'PseudoFixtureDef' in safe_str(_)) + if isinstance(_, PseudoFixtureDef)) gc.garbage[:] = []