From 4ad2af24691a30aed28ef8dc72a5788aa40e1b03 Mon Sep 17 00:00:00 2001 From: medmunds Date: Sun, 6 Mar 2016 10:31:01 -0800 Subject: [PATCH] Allow running specific test cases in runtests --- runtests.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runtests.py b/runtests.py index 7309e31..98b8f77 100644 --- a/runtests.py +++ b/runtests.py @@ -1,6 +1,6 @@ # python setup.py test # or -# python runtests.py +# python runtests.py [anymail.tests.test_x anymail.tests.test_y.SomeTestCase ...] import sys from django.conf import settings @@ -50,10 +50,11 @@ except ImportError: from django.test.simple import DjangoTestSuiteRunner as TestRunner # Django -1.5 -def runtests(): +def runtests(*args): test_runner = TestRunner(verbosity=1) - failures = test_runner.run_tests([APP]) + test_labels = args if len(args) > 0 else [APP] + failures = test_runner.run_tests(test_labels) sys.exit(failures) if __name__ == '__main__': - runtests() + runtests(*sys.argv[1:])