]> granicus.if.org Git - python/commitdiff
Tweak importlib.test.regrtest to only specify the implicit tests to exclude
authorBrett Cannon <bcannon@gmail.com>
Sun, 30 Aug 2009 08:30:35 +0000 (08:30 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 30 Aug 2009 08:30:35 +0000 (08:30 +0000)
when running entire test suite. Allows normal command-line arguments normally
given to test.regrtest to work (e.g. specifying a single test).

Lib/importlib/test/regrtest.py

index 2988d749a50a648be4c35b552039801340e46006..7010165c200e769f7cfa5a4db36dde0a42da957d 100644 (file)
@@ -25,9 +25,11 @@ if __name__ == '__main__':
                 '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)