From 28b6d4c8b8f7bc6c6230b42c2e2db376be559562 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Fri, 24 Jun 2022 05:06:35 +0400 Subject: Allow Setup For Unittests Adds the setup method as a special method for unittest question types. Additionally, a couple QoL fixes are included. I changed `unit` to `self` to clarify what it actually is, and I changed an `lstrip` to a `removeprefix` to avoid removing unintentional portions of the name (for instance `something` -> `omething`) Signed-off-by: Hassan Abouelela --- resources/unittest_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'resources/unittest_template.py') diff --git a/resources/unittest_template.py b/resources/unittest_template.py index 05730ce..6f704f3 100644 --- a/resources/unittest_template.py +++ b/resources/unittest_template.py @@ -64,8 +64,8 @@ def _main() -> None: if not result.wasSuccessful(): RESULT.write( ";".join(chain( - (error[0]._testMethodName.lstrip("test_") for error in result.errors), - (failure[0]._testMethodName.lstrip("test_") for failure in result.failures) + (error[0]._testMethodName.removeprefix("test_") for error in result.errors), + (failure[0]._testMethodName.removeprefix("test_") for failure in result.failures) )) ) -- cgit v1.2.3