]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
add a way to specify the test discovery pattern
authorBob Halley <halley@dnspython.org>
Thu, 6 Oct 2016 23:29:19 +0000 (16:29 -0700)
committerBob Halley <halley@dnspython.org>
Fri, 7 Oct 2016 18:03:44 +0000 (11:03 -0700)
tests/utest.py

index c0448d75f44a88ee51a32572f0f93b742939a704..1e4694c83000f7f391b838ba1c5453e20f50da14 100644 (file)
@@ -7,6 +7,10 @@ except ImportError:
 
 if __name__ == '__main__':
     sys.path.insert(0, os.path.realpath('..'))
-    suites = unittest.defaultTestLoader.discover('.')
+    if len(sys.argv) > 1:
+        pattern=sys.argv[1]
+    else:
+        pattern='test*.py'
+    suites = unittest.defaultTestLoader.discover('.', pattern)
     if not unittest.TextTestRunner(verbosity=2).run(suites).wasSuccessful():
         sys.exit(1)