userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
tracing.py
1
import
uuid
2
3
import
pytest
4
5
from
testsuite.tracing
import
TraceidManager
6
7
8
@pytest.fixture(scope='session')
9
def
testsuite_traceid_generator():
10
"""
11
Fill free to override this fixture with our own.
12
13
@ingroup userver_testsuite_fixtures
14
Part of the [yandex-taxi-testsuite](https://github.com/yandex/yandex-taxi-testsuite/blob/develop/testsuite/plugins/tracing.py#L9)
15
"""
16
17
def
generator():
18
return
uuid.uuid4().hex
19
20
return
generator
21
22
23
@pytest.fixture
24
def
testsuite_trace_id(
25
testsuite_traceid_generator, _testsuite_traceid_history
26
) -> str:
27
"""
28
Testcase trace id.
29
30
@ingroup userver_testsuite_fixtures
31
Part of the [yandex-taxi-testsuite](https://github.com/yandex/yandex-taxi-testsuite/blob/develop/testsuite/plugins/tracing.py#L21)
32
"""
33
trace_id = testsuite_traceid_generator()
34
_testsuite_traceid_history.add(trace_id)
35
return
trace_id
36
37
38
@pytest.fixture
39
def
testsuite_traceid_manager(
40
testsuite_trace_id: str, _testsuite_traceid_history
41
) -> TraceidManager:
42
"""TraceidManager associated with current testcase.
43
44
@returns @ref testsuite.tracing.TraceidManager
45
46
@ingroup userver_testsuite_fixtures
47
Part of the [yandex-taxi-testsuite](https://github.com/yandex/yandex-taxi-testsuite/blob/develop/testsuite/plugins/tracing.py#L33)
48
"""
49
return
TraceidManager(testsuite_trace_id, _testsuite_traceid_history)
50
51
52
@pytest.fixture(scope='session')
53
def
_testsuite_traceid_history():
54
return
set()
en
testsuite
plugins
tracing.py
Generated on
for userver by
Doxygen
1.17.0