Skip to content
Snippets Groups Projects
Commit 3ac7eadd authored by Nicola Sparnacci's avatar Nicola Sparnacci
Browse files

[FIX] Fix f-strings with backslashes


Starting from Python3.10 it's raised an error when f-strings have
backslashes. Handled to add compatibility to that Python version.

Signed-off-by: default avatarNicola Sparnacci <nicola.sparnacci@seco.com>
parent 3429dfc0
No related branches found
No related tags found
1 merge request!37[FIX] Fix f-strings with backslashes
Pipeline #249173 canceled with stages
in 25 seconds
......@@ -368,7 +368,7 @@ def pytest_terminal_summary(terminalreporter):
if failed_tests or skipped_tests_details:
write_separator("", "-")
terminalreporter.write(f"{colorize(f'Total Tests: {total_tests} - Total Time: {total_time:.2f} seconds\n', 'bold')}")
terminalreporter.write(f"{colorize(f'Total Tests: {total_tests} - Total Time: {total_time:.2f} seconds', 'bold')}" + "\n")
terminalreporter.write(f"{colorize(f'Passed: {passed_count}', 'green')}, ")
terminalreporter.write(f"{colorize(f'Expected Failures: {expected_fail_count}', 'blue')}, ")
terminalreporter.write(f"{colorize(f'Failed: {failed_count}', 'red')}, ")
......
......@@ -218,7 +218,9 @@ class TestEnvClass:
mock_source_script.assert_called_once_with(expected_script_path, build_dir)
# Verify environment cleanup and command construction
expected_path = f"{re.sub(r'(:\.|:\)*:|^\.?:|:\.?$)', ':', 'old/path').strip(':')}:{cwd}"
clean_path = re.sub(r'(:\.|:\)*:|^\.?:|:\.?$)', ':', 'old/path').strip(':')
expected_path = f"{clean_path}:{cwd}"
mock_find_changed_environment.assert_called_once()
# Check the printed bash command
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment