mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Correct a comment about testing methods - nowadays most
tests don't run directly on import.
This commit is contained in:
parent
87426cb151
commit
980c4fc04d
1 changed files with 3 additions and 4 deletions
|
|
@ -548,10 +548,9 @@ def runtest_inner(test, generate, verbose, quiet,
|
||||||
abstest = 'test.' + test
|
abstest = 'test.' + test
|
||||||
the_package = __import__(abstest, globals(), locals(), [])
|
the_package = __import__(abstest, globals(), locals(), [])
|
||||||
the_module = getattr(the_package, test)
|
the_module = getattr(the_package, test)
|
||||||
# Most tests run to completion simply as a side-effect of
|
# Old tests run to completion simply as a side-effect of
|
||||||
# being imported. For the benefit of tests that can't run
|
# being imported. For tests based on unittest or doctest,
|
||||||
# that way (like test_threaded_import), explicitly invoke
|
# explicitly invoke their test_main() function (if it exists).
|
||||||
# their test_main() function (if it exists).
|
|
||||||
indirect_test = getattr(the_module, "test_main", None)
|
indirect_test = getattr(the_module, "test_main", None)
|
||||||
if indirect_test is not None:
|
if indirect_test is not None:
|
||||||
indirect_test()
|
indirect_test()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue