@@ -43,7 +43,7 @@ def test_example_test_3(self):
4343class MyClass:
4444 def __init__(self):
4545 self.x = 2
46- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
46+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
4747"""
4848 test_file_name = "test_stack_info_temp.py"
4949
@@ -118,7 +118,7 @@ def test_example_test_3(self):
118118class MyClass:
119119 def __init__(self):
120120 self.x = 2
121- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
121+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
122122"""
123123 test_file_name = "test_stack_info_temp.py"
124124
@@ -182,7 +182,7 @@ def test_example_test_3(self):
182182class MyClass:
183183 def __init__(self):
184184 self.x = 2
185- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
185+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
186186"""
187187 test_dir = (Path (__file__ ).parent .parent / "code_to_optimize" / "tests" / "pytest" ).resolve ()
188188 test_file_name = "test_stack_info_temp.py"
@@ -262,7 +262,7 @@ class MyClass:
262262 def __init__(self):
263263 self.x = 2
264264 # Print out the detected test info each time we instantiate MyClass
265- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
265+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
266266"""
267267
268268 test_file_name = "test_stack_info_recursive_temp.py"
@@ -344,7 +344,7 @@ def test_example_test():
344344class MyClass:
345345 def __init__(self):
346346 self.x = 2
347- print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir !s } ')}}|TEST_INFO_END")
347+ print(f"TEST_INFO_START|{{get_test_info_from_stack('{ test_dir . resolve (). as_posix () } ')}}|TEST_INFO_END")
348348"""
349349 test_dir = (Path (__file__ ).parent .parent / "code_to_optimize" / "tests" / "pytest" ).resolve ()
350350 test_file_name = "test_stack_info_temp.py"
@@ -414,7 +414,7 @@ def test_example_test_3(self):
414414 sample_code = f"""
415415from codeflash.verification.codeflash_capture import codeflash_capture
416416class MyClass:
417- @codeflash_capture(function_name="some_function", tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" ))} ", tests_root="{ test_dir !s } ")
417+ @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 () } ")
418418 def __init__(self, x=2):
419419 self.x = x
420420 """
@@ -537,7 +537,7 @@ def __init__(self):
537537 self.x = 2
538538
539539class MyClass(ParentClass):
540- @codeflash_capture(function_name="some_function", tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" ))} ", tests_root="{ test_dir !s } ")
540+ @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 () } ")
541541 def __init__(self, *args, **kwargs):
542542 super().__init__(*args, **kwargs)
543543 """
@@ -654,9 +654,9 @@ def test_example_test():
654654
655655class MyClass:
656656 @codeflash_capture(
657- function_name="some_function",
658- tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" ))} ",
659- tests_root="{ test_dir !s } "
657+ function_name="some_function",
658+ tmp_dir_path="{ get_run_tmp_file (Path ("test_return_values" )). resolve (). as_posix () } ",
659+ tests_root="{ test_dir . resolve (). as_posix () } "
660660 )
661661 def __init__(self, x=2):
662662 self.x = x
@@ -772,7 +772,7 @@ def test_helper_classes():
772772from code_to_optimize.tests.pytest.helper_file_2 import HelperClass2, AnotherHelperClass
773773
774774class MyClass:
775- @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)
775+ @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)
776776 def __init__(self):
777777 self.x = 1
778778
@@ -786,7 +786,7 @@ def target_function(self):
786786from codeflash.verification.codeflash_capture import codeflash_capture
787787
788788class HelperClass1:
789- @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)
789+ @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)
790790 def __init__(self):
791791 self.y = 1
792792
@@ -798,15 +798,15 @@ def helper1(self):
798798from codeflash.verification.codeflash_capture import codeflash_capture
799799
800800class HelperClass2:
801- @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)
801+ @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)
802802 def __init__(self):
803803 self.z = 2
804804
805805 def helper2(self):
806806 return 2
807807
808808class AnotherHelperClass:
809- @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)
809+ @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)
810810 def __init__(self, *args, **kwargs):
811811 super().__init__(*args, **kwargs)
812812
0 commit comments