diff options
| author | 2021-02-25 18:18:12 +0100 | |
|---|---|---|
| committer | 2021-02-25 18:18:12 +0100 | |
| commit | e57b7ea1f5d93b8f9ebea825a742ed6ec5be1088 (patch) | |
| tree | 594c75383b14b1516b107016413cff7c5f4d3af8 /backend | |
| parent | Document the SNEKBOX_URL env var (diff) | |
Remove unused import
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/routes/forms/unittesting.py | 6 | 
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/routes/forms/unittesting.py b/backend/routes/forms/unittesting.py index ef86e7f..4b362e1 100644 --- a/backend/routes/forms/unittesting.py +++ b/backend/routes/forms/unittesting.py @@ -1,4 +1,3 @@ -import ast  from collections import namedtuple  from itertools import count  from textwrap import indent @@ -15,6 +14,9 @@ with open("resources/unittest_template.py") as file:  UnittestResult = namedtuple("UnittestResult", "question_id return_code passed result") +# Mapping of questions to their generated +_unit_cache: dict[str, str] = {} +  def filter_unittests(form: Form) -> Form:      """ @@ -35,7 +37,7 @@ def _make_unit_code(units: dict[str, str]) -> str:      for unit_name, unit_code in units.items():          result += ( -            f"\ndef test_{unit_name.lstrip('#')}(unit):"  # Function definition  +            f"\ndef test_{unit_name.lstrip('#')}(unit):"  # Function definition              f"\n{indent(unit_code, '    ')}"  # Unit code          )  |