Skip to content

Commit 52083c4

Browse files
Merge pull request #585 from codeflash-ai/unit-test-3.13
3.13 test
2 parents 47e29ec + 8ba7827 commit 52083c4

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ["3.9", "3.10", "3.11", "3.12"]
14+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1515
continue-on-error: true
1616
runs-on: ubuntu-latest
1717
steps:

tests/test_instrument_tests.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ def codeflash_wrap(wrapped, test_module_name, test_class_name, test_name, functi
129129
codeflash_test_index = codeflash_wrap.index[test_id]
130130
invocation_id = f'{{line_id}}_{{codeflash_test_index}}'
131131
"""
132-
if sys.version_info < (3, 12):
133-
expected += """test_stdout_tag = f"{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}"
134-
"""
135-
else:
136-
expected += """test_stdout_tag = f'{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}'
132+
expected += """test_stdout_tag = f'{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}'
137133
"""
138134
expected += """print(f'!$######{{test_stdout_tag}}######$!')
139135
exception = None
@@ -189,9 +185,9 @@ def test_sort(self):
189185
)
190186
os.chdir(original_cwd)
191187
assert success
192-
assert new_test == expected.format(
188+
assert new_test.replace('"', "'") == expected.format(
193189
module_path=Path(f.name).name, tmp_dir_path=get_run_tmp_file(Path("test_return_values"))
194-
)
190+
).replace('"', "'")
195191

196192

197193
def test_perfinjector_only_replay_test() -> None:
@@ -233,11 +229,7 @@ def codeflash_wrap(wrapped, test_module_name, test_class_name, test_name, functi
233229
codeflash_test_index = codeflash_wrap.index[test_id]
234230
invocation_id = f'{{line_id}}_{{codeflash_test_index}}'
235231
"""
236-
if sys.version_info < (3, 12):
237-
expected += """test_stdout_tag = f"{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}"
238-
"""
239-
else:
240-
expected += """test_stdout_tag = f'{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}'
232+
expected += """test_stdout_tag = f'{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}'
241233
"""
242234
expected += """print(f'!$######{{test_stdout_tag}}######$!')
243235
exception = None
@@ -289,9 +281,9 @@ def test_prepare_image_for_yolo():
289281
)
290282
os.chdir(original_cwd)
291283
assert success
292-
assert new_test == expected.format(
284+
assert new_test.replace('"', "'") == expected.format(
293285
module_path=Path(f.name).name, tmp_dir_path=get_run_tmp_file(Path("test_return_values"))
294-
)
286+
).replace('"', "'")
295287

296288

297289
def test_perfinjector_bubble_sort_results() -> None:

0 commit comments

Comments
 (0)