From: Bob Halley Date: Thu, 6 Oct 2016 23:29:19 +0000 (-0700) Subject: add a way to specify the test discovery pattern X-Git-Tag: v1.16.0~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=565a757697fafe5307fe540a00b4d7876333323c;p=thirdparty%2Fdnspython.git add a way to specify the test discovery pattern --- diff --git a/tests/utest.py b/tests/utest.py index c0448d75..1e4694c8 100644 --- a/tests/utest.py +++ b/tests/utest.py @@ -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)