aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-06-25 12:17:13 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-06-25 12:17:13 +0400
commit23d0e87e8f3d039fb4c5a57a3f6d6c1a0429ac95 (patch)
tree0820127032e461178c68f030486b6e293df245d7 /backend
parentMerge pull request #179 from python-discord/add-setup (diff)
Ensure All Tests Are Prefixed By `test_`
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend')
-rw-r--r--backend/routes/forms/unittesting.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/routes/forms/unittesting.py b/backend/routes/forms/unittesting.py
index 13fa639..2bfeaa9 100644
--- a/backend/routes/forms/unittesting.py
+++ b/backend/routes/forms/unittesting.py
@@ -40,7 +40,8 @@ def _make_unit_code(units: dict[str, str]) -> str:
if unit_name == "setUp":
result += "\ndef setUp(self):"
else:
- result += f"\nasync def {unit_name.removeprefix('#')}(self):"
+ name = f"test_{unit_name.removeprefix('#').removeprefix('test_')}"
+ result += f"\nasync def {name}(self):"
# Unite code
result += f"\n{indent(unit_code, ' ')}"