@@ -42,7 +42,7 @@ def test_example_test_3(self):
4242class MyClass:
4343 def __init__(self):
4444 self.x = 2
45- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
45+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
4646"""
4747 test_file_name = "test_stack_info_temp.py"
4848
@@ -117,7 +117,7 @@ def test_example_test_3(self):
117117class MyClass:
118118 def __init__(self):
119119 self.x = 2
120- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
120+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
121121"""
122122 test_file_name = "test_stack_info_temp.py"
123123
@@ -181,7 +181,7 @@ def test_example_test_3(self):
181181class MyClass:
182182 def __init__(self):
183183 self.x = 2
184- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
184+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
185185"""
186186 test_dir = (Path (__file__ ).parent .parent / "code_to_optimize" / "tests" / "pytest" ).resolve ()
187187 test_file_name = "test_stack_info_temp.py"
@@ -261,7 +261,7 @@ class MyClass:
261261 def __init__(self):
262262 self.x = 2
263263 # Print out the detected test info each time we instantiate MyClass
264- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
264+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
265265"""
266266
267267 test_file_name = "test_stack_info_recursive_temp.py"
@@ -343,7 +343,7 @@ def test_example_test():
343343class MyClass:
344344 def __init__(self):
345345 self.x = 2
346- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
346+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
347347"""
348348 test_dir = (Path (__file__ ).parent .parent / "code_to_optimize" / "tests" / "pytest" ).resolve ()
349349 test_file_name = "test_stack_info_temp.py"
@@ -413,7 +413,7 @@ def test_example_test_3(self):
413413 sample_code = f"""
414414from codeflash.verification.codeflash_capture import codeflash_capture
415415class MyClass:
416- @codeflash_capture(function_name="some_function", tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" ))} ", tests_root="{ test_dir !s } ")
416+ @codeflash_capture(function_name="some_function", tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ", tests_root="{ test_dir . resolve (). as_posix () } ")
417417 def __init__(self, x=2):
418418 self.x = x
419419 """
@@ -536,7 +536,7 @@ def __init__(self):
536536 self.x = 2
537537
538538class MyClass(ParentClass):
539- @codeflash_capture(function_name="some_function", tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" ))} ", tests_root="{ test_dir !s } ")
539+ @codeflash_capture(function_name="some_function", tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ", tests_root="{ test_dir . resolve (). as_posix () } ")
540540 def __init__(self, *args, **kwargs):
541541 super().__init__(*args, **kwargs)
542542 """
@@ -653,9 +653,9 @@ def test_example_test():
653653
654654class MyClass:
655655 @codeflash_capture(
656- function_name="some_function",
657- tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" ))} ",
658- tests_root="{ test_dir !s } "
656+ function_name="some_function",
657+ tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ",
658+ tests_root="{ test_dir . resolve (). as_posix () } "
659659 )
660660 def __init__(self, x=2):
661661 self.x = x
@@ -771,7 +771,7 @@ def test_helper_classes():
771771from code_to_optimize.tests.pytest.helper_file_2 import HelperClass2, AnotherHelperClass
772772
773773class MyClass:
774- @codeflash_capture(function_name='MyClass.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" ))} ', tests_root="{ test_dir !s } " , is_fto=True)
774+ @codeflash_capture(function_name='MyClass.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ', tests_root="{ test_dir . resolve (). as_posix () } " , is_fto=True)
775775 def __init__(self):
776776 self.x = 1
777777
@@ -785,7 +785,7 @@ def target_function(self):
785785from codeflash.verification.codeflash_capture import codeflash_capture
786786
787787class HelperClass1:
788- @codeflash_capture(function_name='HelperClass1.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" ))} ', tests_root="{ test_dir !s } ", is_fto=False)
788+ @codeflash_capture(function_name='HelperClass1.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ', tests_root="{ test_dir . resolve (). as_posix () } ", is_fto=False)
789789 def __init__(self):
790790 self.y = 1
791791
@@ -797,15 +797,15 @@ def helper1(self):
797797from codeflash.verification.codeflash_capture import codeflash_capture
798798
799799class HelperClass2:
800- @codeflash_capture(function_name='HelperClass2.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" ))} ', tests_root="{ test_dir !s } ", is_fto=False)
800+ @codeflash_capture(function_name='HelperClass2.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ', tests_root="{ test_dir . resolve (). as_posix () } ", is_fto=False)
801801 def __init__(self):
802802 self.z = 2
803803
804804 def helper2(self):
805805 return 2
806806
807807class AnotherHelperClass:
808- @codeflash_capture(function_name='AnotherHelperClass.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" ))} ', tests_root="{ test_dir !s } ", is_fto=False)
808+ @codeflash_capture(function_name='AnotherHelperClass.__init__', tmp_dir_path='{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ', tests_root="{ test_dir . resolve (). as_posix () } ", is_fto=False)
809809 def __init__(self, *args, **kwargs):
810810 super().__init__(*args, **kwargs)
811811
0 commit comments