@@ -30,11 +30,9 @@ def get_run_tmp_file(file_path: Path) -> Path: # moved from codeflash/code_util
3030 return Path (get_run_tmp_file .tmpdir .name ) / file_path
3131
3232
33- def extract_test_context_from_frame () -> tuple [str , str | None , str ]:
34- # test_module = os.environ.get("CODEFLASH_TEST_MODULE")
33+ def extract_test_context_from_env () -> tuple [str , str | None , str ]:
3534 test_module = os .environ ["CODEFLASH_TEST_MODULE" ]
3635 test_class = os .environ .get ("CODEFLASH_TEST_CLASS" , None )
37- # test_function = os.environ.get("CODEFLASH_TEST_FUNCTION")
3836 test_function = os .environ ["CODEFLASH_TEST_FUNCTION" ]
3937
4038 if test_module and test_function :
@@ -52,7 +50,7 @@ async def async_wrapper(*args: Any, **kwargs: Any) -> Any: # noqa: ANN401
5250 function_name = func .__name__
5351 line_id = f"{ func .__name__ } _{ func .__code__ .co_firstlineno } "
5452 loop_index = int (os .environ ["CODEFLASH_LOOP_INDEX" ])
55- test_module_name , test_class_name , test_name = extract_test_context_from_frame ()
53+ test_module_name , test_class_name , test_name = extract_test_context_from_env ()
5654
5755 test_id = f"{ test_module_name } :{ test_class_name } :{ test_name } :{ line_id } :{ loop_index } "
5856
@@ -129,7 +127,7 @@ async def async_wrapper(*args: Any, **kwargs: Any) -> Any: # noqa: ANN401
129127 line_id = f"{ func .__name__ } _{ func .__code__ .co_firstlineno } "
130128 loop_index = int (os .environ ["CODEFLASH_LOOP_INDEX" ])
131129
132- test_module_name , test_class_name , test_name = extract_test_context_from_frame ()
130+ test_module_name , test_class_name , test_name = extract_test_context_from_env ()
133131
134132 test_id = f"{ test_module_name } :{ test_class_name } :{ test_name } :{ line_id } :{ loop_index } "
135133
0 commit comments