Skip to content

Commit 593d2db

Browse files
committed
attempt to modify tests for later python versions to work
1 parent 9e0aa9c commit 593d2db

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
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.18, 3.10.13, 3.11.6, 3.12.1, 3.13.0]
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: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ def codeflash_wrap(wrapped, test_module_name, test_class_name, test_name, functi
125125
codeflash_test_index = codeflash_wrap.index[test_id]
126126
invocation_id = f'{{line_id}}_{{codeflash_test_index}}'
127127
"""
128-
if sys.version_info < (3, 12):
129-
expected += """print(f"!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!")"""
130-
else:
131-
expected += """print(f'!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!')"""
128+
expected += """print(f"!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!")"""
132129
expected += """
133130
exception = None
134131
gc.disable()
@@ -226,10 +223,7 @@ def codeflash_wrap(wrapped, test_module_name, test_class_name, test_name, functi
226223
codeflash_test_index = codeflash_wrap.index[test_id]
227224
invocation_id = f'{{line_id}}_{{codeflash_test_index}}'
228225
"""
229-
if sys.version_info < (3, 12):
230-
expected += """print(f"!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!")"""
231-
else:
232-
expected += """print(f'!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!')"""
226+
expected += """print(f"!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!")"""
233227
expected += """
234228
exception = None
235229
gc.disable()
@@ -2842,10 +2836,7 @@ def codeflash_wrap(wrapped, test_module_name, test_class_name, test_name, functi
28422836
codeflash_test_index = codeflash_wrap.index[test_id]
28432837
invocation_id = f'{{line_id}}_{{codeflash_test_index}}'
28442838
"""
2845-
if sys.version_info < (3, 12):
2846-
expected += """ print(f"!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!")"""
2847-
else:
2848-
expected += """ print(f'!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!')"""
2839+
expected += """ print(f"!######{{test_module_name}}:{{(test_class_name + '.' if test_class_name else '')}}{{test_name}}:{{function_name}}:{{loop_index}}:{{invocation_id}}######!")"""
28492840
expected += """
28502841
exception = None
28512842
gc.disable()

0 commit comments

Comments
 (0)