diff options
author | 2023-08-12 19:58:38 +0300 | |
---|---|---|
committer | 2023-08-12 19:58:38 +0300 | |
commit | 921ab3f41ff97146d25a8c86dc508cf71db3db2f (patch) | |
tree | 7bb79844cc44dbf356e38ac4e353756850bc9f9f | |
parent | Remove sentry-env (#241) (diff) | |
parent | Add tearDown feature to unittests (diff) |
Merge pull request #242 from python-discord/unittests-feature
Add tearDown feature to unittests
-rw-r--r-- | backend/routes/forms/unittesting.py | 2 |
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):" |