diff options
author | 2021-02-25 14:45:35 +0100 | |
---|---|---|
committer | 2021-02-25 14:45:35 +0100 | |
commit | bfc44e81cb0ea6b9997d8ca701b3f525ddcd50df (patch) | |
tree | f719e6ca2f4081f8048abd928dcff7fec5e03f54 | |
parent | Remove unneeded temp variable (diff) |
Make _make_unit_code more readable
-rw-r--r-- | backend/routes/forms/unittesting.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/routes/forms/unittesting.py b/backend/routes/forms/unittesting.py index c11e4ad..ef86e7f 100644 --- a/backend/routes/forms/unittesting.py +++ b/backend/routes/forms/unittesting.py @@ -34,7 +34,10 @@ def _make_unit_code(units: dict[str, str]) -> str: result = "" for unit_name, unit_code in units.items(): - result += f"\ndef test_{unit_name.lstrip('#')}(unit):\n{indent(unit_code, ' ')}" + result += ( + f"\ndef test_{unit_name.lstrip('#')}(unit):" # Function definition + f"\n{indent(unit_code, ' ')}" # Unit code + ) return indent(result, " ") |