forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythonGH-71383: IDLE - Document testing subsets of modules
- Loading branch information
1 parent
7d2deaf
commit 58feae3
Showing
3 changed files
with
29 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
'''idlelib.idle_test is a private implementation of test.test_idle, | ||
which tests the IDLE application as part of the stdlib test suite. | ||
Run IDLE tests alone with "python -m test.test_idle". | ||
Starting with Python 3.6, IDLE requires tcl/tk 8.5 or later. | ||
"""idlelib.idle_test implements test.test_idle, which tests the IDLE | ||
application as part of the stdlib test suite. | ||
Run IDLE tests alone with "python -m test.test_idle (-v)". | ||
This package and its contained modules are subject to change and | ||
any direct use is at your own risk. | ||
''' | ||
""" | ||
from os.path import dirname | ||
|
||
# test_idle imports load_tests for test discovery (default all). | ||
# To run subsets of idlelib module tests, insert '[<chars>]' after '_'. | ||
# Example: insert '[ac]' for modules beginning with 'a' or 'c'. | ||
# Additional .discover/.addTest pairs with separate inserts work. | ||
# Example: pairs with 'c' and 'g' test c* files and grep. | ||
|
||
def load_tests(loader, standard_tests, pattern): | ||
this_dir = dirname(__file__) | ||
top_dir = dirname(dirname(this_dir)) | ||
package_tests = loader.discover(start_dir=this_dir, pattern='test*.py', | ||
module_tests = loader.discover(start_dir=this_dir, | ||
pattern='test_*.py', # Insert here. | ||
top_level_dir=top_dir) | ||
standard_tests.addTests(package_tests) | ||
standard_tests.addTests(module_tests) | ||
## module_tests = loader.discover(start_dir=this_dir, | ||
## pattern='test_*.py', # Insert here. | ||
## top_level_dir=top_dir) | ||
## standard_tests.addTests(module_tests) | ||
return standard_tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters