Skip to content

Commit 43038c7

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
More test cases
1 parent cb8bcd8 commit 43038c7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/units/locks/tracer/test_tracer.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ def release(self):
7373
with pytest.raises(StrangeEventOrderError):
7474
wrapper.was_event_locked('kek')
7575

76+
with pytest.raises(StrangeEventOrderError):
77+
wrapper.was_event_locked('kek', raise_exception=True)
78+
79+
assert not wrapper.was_event_locked('kek', raise_exception=False)
80+
7681

7782
def test_event_is_locked_if_there_was_no_events():
7883
wrapper = LockTraceWrapper(Lock())
@@ -82,6 +87,9 @@ def test_event_is_locked_if_there_was_no_events():
8287
with pytest.raises(ThereWasNoSuchEventError, match=match('No events with identifier "kek" occurred in any of the threads, so the question "was it thread-safe" is meaningless.')):
8388
wrapper.was_event_locked('kek')
8489

90+
with pytest.raises(ThereWasNoSuchEventError, match=match('No events with identifier "kek" occurred in any of the threads, so the question "was it thread-safe" is meaningless.')):
91+
wrapper.was_event_locked('kek', raise_exception=True)
92+
8593

8694
def test_event_is_locked_if_there_are_only_opening_and_slosing_events():
8795
wrapper = LockTraceWrapper(Lock())
@@ -94,6 +102,9 @@ def test_event_is_locked_if_there_are_only_opening_and_slosing_events():
94102
with pytest.raises(ThereWasNoSuchEventError, match=match('No events with identifier "kek" occurred in any of the threads, so the question "was it thread-safe" is meaningless.')):
95103
wrapper.was_event_locked('kek')
96104

105+
with pytest.raises(ThereWasNoSuchEventError, match=match('No events with identifier "kek" occurred in any of the threads, so the question "was it thread-safe" is meaningless.')):
106+
wrapper.was_event_locked('kek', raise_exception=True)
107+
97108

98109
def test_simple_case_of_locked_event():
99110
wrapper = LockTraceWrapper(Lock())
@@ -219,3 +230,6 @@ def test_unknown_event_type():
219230

220231
with pytest.raises(ThereWasNoSuchEventError, match=match('No events with identifier "lol" occurred in any of the threads, so the question "was it thread-safe" is meaningless.')):
221232
wrapper.was_event_locked('lol')
233+
234+
with pytest.raises(ThereWasNoSuchEventError, match=match('No events with identifier "lol" occurred in any of the threads, so the question "was it thread-safe" is meaningless.')):
235+
wrapper.was_event_locked('lol', raise_exception=True)

0 commit comments

Comments
 (0)