Skip to content

Commit 8b6ef48

Browse files
authored
Merge pull request RustPython#4757 from Brain-organizer/testlistcompsupdate
update test_listcomps.py from cpython 3.11.2
2 parents 31c33c8 + 7c3115d commit 8b6ef48

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

Lib/test/test_listcomps.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import doctest
2+
import unittest
3+
4+
15
doctests = """
26
########### Tests borrowed from or inspired by test_genexps.py ############
37
@@ -144,21 +148,10 @@
144148

145149
__test__ = {'doctests' : doctests}
146150

147-
def test_main(verbose=None):
148-
import sys
149-
from test import support
150-
from test import test_listcomps
151-
support.run_doctest(test_listcomps, verbose)
152-
153-
# verify reference counting
154-
if verbose and hasattr(sys, "gettotalrefcount"):
155-
import gc
156-
counts = [None] * 5
157-
for i in range(len(counts)):
158-
support.run_doctest(test_listcomps, verbose)
159-
gc.collect()
160-
counts[i] = sys.gettotalrefcount()
161-
print(counts)
151+
def load_tests(loader, tests, pattern):
152+
tests.addTest(doctest.DocTestSuite())
153+
return tests
154+
162155

163156
if __name__ == "__main__":
164-
test_main(verbose=True)
157+
unittest.main()

0 commit comments

Comments
 (0)