Skip to content

Commit 921ab3f

Browse files
authored
Merge pull request #242 from python-discord/unittests-feature
Add tearDown feature to unittests
2 parents ea1b062 + 5ffc84b commit 921ab3f

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)