MCPcopy Create free account
hub / github.com/microsoft/debugpy / make_timeline

Function make_timeline

tests/tests/test_timeline.py:34–66  ·  view source on GitHub ↗

Provides a timeline factory. All timelines created by this factory are automatically finalized and checked for basic consistency after the end of the test.

(request)

Source from the content-addressed store, hash-verified

32
33@pytest.fixture
34def make_timeline(request):
35 """Provides a timeline factory. All timelines created by this factory
36 are automatically finalized and checked for basic consistency after the
37 end of the test.
38 """
39
40 timelines = []
41
42 def factory():
43 timeline = Timeline()
44 timelines.append(timeline)
45 with timeline.frozen():
46 assert timeline.beginning is not None
47 initial_history = [some.object.same_as(timeline.beginning)]
48 assert timeline.history() == initial_history
49 return timeline, initial_history
50
51 yield factory
52 log.newline()
53
54 try:
55 failed = request.node.call_result.failed
56 except AttributeError:
57 pass
58 else:
59 if not failed:
60 for timeline in timelines:
61 timeline.finalize()
62 history = timeline.history()
63 history.sort(key=lambda occ: occ.timestamp)
64 assert history == timeline.history()
65 assert history[-1] == Mark("FINISH")
66 timeline.close()
67
68
69@pytest.mark.timeout(1)

Callers 14

test_occurrencesFunction · 0.85
test_eventFunction · 0.85
test_request_responseFunction · 0.85
test_afterFunction · 0.85
test_beforeFunction · 0.85
test_andFunction · 0.85
test_orFunction · 0.85
test_xorFunction · 0.85
test_conditionalFunction · 0.85
test_lower_boundFunction · 0.85
test_frozenFunction · 0.85
test_unobservedFunction · 0.85

Calls 4

finalizeMethod · 0.95
historyMethod · 0.95
closeMethod · 0.95
MarkFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…