mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ec4539550
commit
91ade25ba3
@@ -346,7 +346,7 @@ class Runner(DiscoverRunner):
|
||||
prefix = "unittest.loader._FailedTest."
|
||||
for test_name in get_test_names(suite):
|
||||
if test_name.startswith(prefix):
|
||||
test_name = test_name[len(prefix) :]
|
||||
test_name = test_name.removeprefix(prefix)
|
||||
for label in test_labels:
|
||||
# This code block is for when a test label is
|
||||
# directly provided, for example:
|
||||
|
||||
Reference in New Issue
Block a user