aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Janine vN <[email protected]>2023-08-11 19:15:50 -0400
committerGravatar Janine vN <[email protected]>2023-08-11 19:15:50 -0400
commit5ffc84b803e2ffdaac9039c81c7a069df8f7c2f7 (patch)
tree7bb79844cc44dbf356e38ac4e353756850bc9f9f
parentRemove sentry-env (#241) (diff)
Add tearDown feature to unittests
-rw-r--r--backend/routes/forms/unittesting.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/routes/forms/unittesting.py b/backend/routes/forms/unittesting.py
index 1b042e4..a02afea 100644
--- a/backend/routes/forms/unittesting.py
+++ b/backend/routes/forms/unittesting.py
@@ -43,6 +43,8 @@ def _make_unit_code(units: dict[str, str]) -> str:
# Function definition
if unit_name == "setUp":
result += "\ndef setUp(self):"
+ elif unit_name == "tearDown":
+ result += "\ndef tearDown(self):"
else:
name = f"test_{unit_name.removeprefix('#').removeprefix('test_')}"
result += f"\nasync def {name}(self):"