55from allure_commons .utils import uuid4
66from allure_commons .utils import represent
77from 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
99from allure_commons .reporter import AllureReporter
1010from allure_commons .model2 import TestStepResult , TestResult , TestBeforeResult , TestAfterResult
1111from allure_commons .model2 import TestResultContainer
@@ -36,7 +36,7 @@ def __init__(self, config):
3636 @allure_commons .hookimpl
3737 def start_step (self , uuid , title , params ):
3838 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 () )
4040 self .allure_logger .start_step (None , uuid , step )
4141
4242 @allure_commons .hookimpl
@@ -48,7 +48,7 @@ def stop_step(self, uuid, exc_type, exc_val, exc_tb):
4848
4949 @allure_commons .hookimpl
5050 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 () )
5252 self .allure_logger .start_after_fixture (parent_uuid , uuid , after_fixture )
5353
5454 @allure_commons .hookimpl
@@ -61,15 +61,15 @@ def stop_fixture(self, parent_uuid, uuid, name, exc_type, exc_val, exc_tb):
6161 @pytest .hookimpl (hookwrapper = True , tryfirst = True )
6262 def pytest_runtest_protocol (self , item , nextitem ):
6363 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 () )
6565 self .allure_logger .schedule_test (uuid , test_result )
6666 yield
6767
6868 @pytest .hookimpl (hookwrapper = True )
6969 def pytest_runtest_setup (self , item ):
7070 if not self ._cache .get (item .nodeid ):
7171 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 () )
7373 self .allure_logger .schedule_test (uuid , test_result )
7474
7575 yield
@@ -80,7 +80,7 @@ def pytest_runtest_setup(self, item):
8080 group_uuid = self ._cache .get (fixturedef )
8181 if not group_uuid :
8282 group_uuid = self ._cache .push (fixturedef )
83- group = TestResultContainer (uuid = group_uuid )
83+ group = TestResultContainer (uuid = group_uuid , thrd = thread_tag_detail () )
8484 self .allure_logger .start_group (group_uuid , group )
8585 self .allure_logger .update_group (group_uuid , children = uuid )
8686 params = item .callspec .params if hasattr (item , 'callspec' ) else {}
@@ -128,13 +128,13 @@ def pytest_fixture_setup(self, fixturedef, request):
128128
129129 if not container_uuid :
130130 container_uuid = self ._cache .push (fixturedef )
131- container = TestResultContainer (uuid = container_uuid )
131+ container = TestResultContainer (uuid = container_uuid , thrd = thread_tag_detail () )
132132 self .allure_logger .start_group (container_uuid , container )
133133
134134 self .allure_logger .update_group (container_uuid , start = now ())
135135
136136 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 () )
138138 self .allure_logger .start_before_fixture (container_uuid , before_fixture_uuid , before_fixture )
139139
140140 outcome = yield
0 commit comments