Skip to content

Commit 5ffc84b

Browse files
committed
Add tearDown feature to unittests
1 parent ea1b062 commit 5ffc84b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/routes/forms/unittesting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def _make_unit_code(units: dict[str, str]) -> str:
4343
# Function definition
4444
if unit_name == "setUp":
4545
result += "\ndef setUp(self):"
46+
elif unit_name == "tearDown":
47+
result += "\ndef tearDown(self):"
4648
else:
4749
name = f"test_{unit_name.removeprefix('#').removeprefix('test_')}"
4850
result += f"\nasync def {name}(self):"

0 commit comments

Comments
 (0)