Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions tests/profiling_v2/collector/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
Loading