|
37 | 37 | from .filter import filter_invalid_selector_path |
38 | 38 | from .parser import parse_case_attributes |
39 | 39 | from .stream import pytest_main_with_output |
40 | | -from .header_injection import set_current_test_nodeid |
| 40 | + |
| 41 | +# from .header_injection import set_current_test_nodeid |
41 | 42 | from .conftest_generator import generate_conftest_for_header_injection |
42 | 43 |
|
43 | 44 |
|
@@ -77,9 +78,9 @@ def pytest_runtest_logstart(self, nodeid: str, location: Any) -> None: |
77 | 78 | # 设置当前测试用例的nodeid到上下文 |
78 | 79 | # 注意:这里使用处理后的 testcase_class_name,与 conftest.py 中的格式可能不同 |
79 | 80 | # conftest.py 中使用原始 nodeid,这里使用处理后的名称 |
80 | | - if should_enable_header_injection(): |
81 | | - testcase_class_name = testcase_name.split("?", 1)[-1] |
82 | | - set_current_test_nodeid(testcase_class_name) |
| 81 | + # if should_enable_header_injection(): |
| 82 | + # testcase_class_name = testcase_name.split("?", 1)[-1] |
| 83 | + # set_current_test_nodeid(testcase_class_name) |
83 | 84 |
|
84 | 85 | test_result = TestResult( |
85 | 86 | Test=TestCase(Name=testcase_name), |
@@ -226,8 +227,8 @@ def pytest_runtest_logfinish(self, nodeid: str, location: Any) -> None: |
226 | 227 | self.testdata.pop(testcase_name, None) |
227 | 228 |
|
228 | 229 | # 清除当前测试用例的nodeid |
229 | | - if should_enable_header_injection(): |
230 | | - set_current_test_nodeid(None) |
| 230 | + # if should_enable_header_injection(): |
| 231 | + # set_current_test_nodeid(None) |
231 | 232 |
|
232 | 233 | logger.info(f"E {nodeid} runtest_logfinish") |
233 | 234 |
|
|
0 commit comments