diff options
author | 2021-02-25 14:42:43 +0100 | |
---|---|---|
committer | 2021-02-25 14:42:43 +0100 | |
commit | 52f12f4ab939b467c2ba88f5f83094fb1392baa2 (patch) | |
tree | d23d0818ec36391367f011def6e7b658144bd33e | |
parent | Don't try to parse the composed code (diff) |
Make use of list.copy() instead of [:]
-rw-r--r-- | backend/routes/forms/unittesting.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/routes/forms/unittesting.py b/backend/routes/forms/unittesting.py index 198d950..c11e4ad 100644 --- a/backend/routes/forms/unittesting.py +++ b/backend/routes/forms/unittesting.py @@ -78,7 +78,7 @@ async def execute_unittest(form_response: FormResponse, form: Form) -> list[Unit code = TEST_TEMPLATE.replace("### USER CODE", user_code) code = code.replace("### UNIT CODE", unit_code) - + try: response = await _post_eval(code) except HTTPStatusError: @@ -97,7 +97,7 @@ async def execute_unittest(form_response: FormResponse, form: Form) -> list[Unit failed_tests = stdout[1:].strip().split(";") # Redact failed hidden tests - for i, failed_test in enumerate(failed_tests[:]): + for i, failed_test in enumerate(failed_tests.copy()): if failed_test in hidden_tests: failed_tests[i] = f"hidden_test_{hidden_tests[failed_test]}" |