diff --git a/tests/profiling_v2/collector/test_threading.py b/tests/profiling_v2/collector/test_threading.py index 084f1c77356..8ace8c80ecd 100644 --- a/tests/profiling_v2/collector/test_threading.py +++ b/tests/profiling_v2/collector/test_threading.py @@ -48,27 +48,6 @@ def test_repr(): ) -def test_wrapper(): - collector = collector_threading.ThreadingLockCollector() - with collector: - - class Foobar(object): - lock_class = threading.Lock - - def __init__(self): - lock = self.lock_class() - assert lock.acquire() - lock.release() - - # Try to access the attribute - lock = Foobar.lock_class() - assert lock.acquire() - lock.release() - - # Try this way too - Foobar() - - def test_patch(): lock = threading.Lock collector = collector_threading.ThreadingLockCollector() @@ -302,6 +281,25 @@ def teardown_method(self, method): print("Error removing file: {}".format(e)) pass + def test_wrapper(self): + collector = collector_threading.ThreadingLockCollector() + with collector: + + class Foobar(object): + lock_class = threading.Lock + + def __init__(self): + lock = self.lock_class() + assert lock.acquire() + lock.release() + + lock = Foobar.lock_class() + assert lock.acquire() + lock.release() + + # Try this way too + Foobar() + # Tests def test_lock_events(self): # The first argument is the recorder.Recorder which is used for the