Speed up test_urlsplit_normalization by jacobtylerwalls · Pull Request #26688 · python/cpython
Noticed while working on #26687 that one of the tests in test_urlparse took ~7s. Here I've short-circuited the filtering of a massive list comprehension (sys.maxunicode for me is 1,114,111) by checking if not empty before running split(), set(), &, etc.
LMK if this needs a ticket.
$ ./python.exe -m unittest test.test_urlparse.UrlParseTestCase.test_urlsplit_normalization
Before
Ran 1 test in 6.981s
After
Ran 1 test in 2.459s