5
5
from allure_commons .utils import uuid4
6
6
from allure_commons .utils import represent
7
7
from allure_commons .utils import platform_label
8
- from allure_commons .utils import host_tag , thread_tag
8
+ from allure_commons .utils import host_tag , thread_tag , thread_tag_detail
9
9
from allure_commons .reporter import AllureReporter
10
10
from allure_commons .model2 import TestStepResult , TestResult , TestBeforeResult , TestAfterResult
11
11
from allure_commons .model2 import TestResultContainer
@@ -36,7 +36,7 @@ def __init__(self, config):
36
36
@allure_commons .hookimpl
37
37
def start_step (self , uuid , title , params ):
38
38
parameters = [Parameter (name = name , value = value ) for name , value in params .items ()]
39
- step = TestStepResult (name = title , start = now (), parameters = parameters )
39
+ step = TestStepResult (name = title , start = now (), parameters = parameters , thrd = thread_tag_detail () )
40
40
self .allure_logger .start_step (None , uuid , step )
41
41
42
42
@allure_commons .hookimpl
@@ -48,7 +48,7 @@ def stop_step(self, uuid, exc_type, exc_val, exc_tb):
48
48
49
49
@allure_commons .hookimpl
50
50
def start_fixture (self , parent_uuid , uuid , name ):
51
- after_fixture = TestAfterResult (name = name , start = now ())
51
+ after_fixture = TestAfterResult (name = name , start = now (), thrd = thread_tag_detail () )
52
52
self .allure_logger .start_after_fixture (parent_uuid , uuid , after_fixture )
53
53
54
54
@allure_commons .hookimpl
@@ -61,15 +61,15 @@ def stop_fixture(self, parent_uuid, uuid, name, exc_type, exc_val, exc_tb):
61
61
@pytest .hookimpl (hookwrapper = True , tryfirst = True )
62
62
def pytest_runtest_protocol (self , item , nextitem ):
63
63
uuid = self ._cache .push (item .nodeid )
64
- test_result = TestResult (name = item .name , uuid = uuid , start = now (), stop = now ())
64
+ test_result = TestResult (name = item .name , uuid = uuid , start = now (), stop = now (), thrd = thread_tag_detail () )
65
65
self .allure_logger .schedule_test (uuid , test_result )
66
66
yield
67
67
68
68
@pytest .hookimpl (hookwrapper = True )
69
69
def pytest_runtest_setup (self , item ):
70
70
if not self ._cache .get (item .nodeid ):
71
71
uuid = self ._cache .push (item .nodeid )
72
- test_result = TestResult (name = item .name , uuid = uuid , start = now (), stop = now ())
72
+ test_result = TestResult (name = item .name , uuid = uuid , start = now (), stop = now (), thrd = thread_tag_detail () )
73
73
self .allure_logger .schedule_test (uuid , test_result )
74
74
75
75
yield
@@ -80,7 +80,7 @@ def pytest_runtest_setup(self, item):
80
80
group_uuid = self ._cache .get (fixturedef )
81
81
if not group_uuid :
82
82
group_uuid = self ._cache .push (fixturedef )
83
- group = TestResultContainer (uuid = group_uuid )
83
+ group = TestResultContainer (uuid = group_uuid , thrd = thread_tag_detail () )
84
84
self .allure_logger .start_group (group_uuid , group )
85
85
self .allure_logger .update_group (group_uuid , children = uuid )
86
86
params = item .callspec .params if hasattr (item , 'callspec' ) else {}
@@ -128,13 +128,13 @@ def pytest_fixture_setup(self, fixturedef, request):
128
128
129
129
if not container_uuid :
130
130
container_uuid = self ._cache .push (fixturedef )
131
- container = TestResultContainer (uuid = container_uuid )
131
+ container = TestResultContainer (uuid = container_uuid , thrd = thread_tag_detail () )
132
132
self .allure_logger .start_group (container_uuid , container )
133
133
134
134
self .allure_logger .update_group (container_uuid , start = now ())
135
135
136
136
before_fixture_uuid = uuid4 ()
137
- before_fixture = TestBeforeResult (name = fixture_name , start = now ())
137
+ before_fixture = TestBeforeResult (name = fixture_name , start = now (), thrd = thread_tag_detail () )
138
138
self .allure_logger .start_before_fixture (container_uuid , before_fixture_uuid , before_fixture )
139
139
140
140
outcome = yield
0 commit comments