diff --git a/Lib/importlib/test/regrtest.py b/Lib/importlib/test/regrtest.py index 2988d749a50..7010165c200 100644 --- a/Lib/importlib/test/regrtest.py +++ b/Lib/importlib/test/regrtest.py @@ -25,9 +25,11 @@ 'test_pkg', # Does not expect __loader__ attribute 'test_pydoc', # Does not expect __loader__ attribute ] - # No programmatic way to specify tests to exclude - sys.argv.extend(exclude) - # verbose=True, quiet=False for all failure info - # tests=[...] for specific tests to run + # Switching on --exclude implies running all test but the ones listed, so + # only use it when one is not running an explicit test + if len(sys.argv) == 1: + # No programmatic way to specify tests to exclude + sys.argv.extend(exclude) + regrtest.main(quiet=True)