From 4b7ef449250b3dad7c5a1be5ed322d031bba02bd Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 12 Sep 2015 22:27:52 -0700 Subject: [PATCH] runtests: allow specifying files to test --- runtests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtests.py b/runtests.py index 5b64f8b..b4d7996 100755 --- a/runtests.py +++ b/runtests.py @@ -11,7 +11,10 @@ suites = [] # Yay, import hacks! sys.path.append(os.path.join(os.getcwd(), 'tests')) -for testfile in glob.glob('tests/test_*.py'): + +query = sys.argv[1:] or glob.glob('tests/test_*.py') + +for testfile in query: # Strip the tests/ and .py extension: tests/test_whatever.py => test_whatever module = testfile.replace('.py', '').replace('tests/', '') module = __import__(module)