From 355ff3b3ebeab4566da9c978f994aa189947c791 Mon Sep 17 00:00:00 2001 From: Jason Kraus Date: Mon, 22 Feb 2010 17:26:36 -0800 Subject: [PATCH] added SKIP_TESTS settings --- .gitignore | 3 ++- src/test_extensions/management/commands/test.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a801c91..32f8973 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store +*~ *.pyc build/* dist/* -src/*.egg-info/* \ No newline at end of file +src/*.egg-info/* diff --git a/src/test_extensions/management/commands/test.py b/src/test_extensions/management/commands/test.py index 4b33467..1f868a5 100755 --- a/src/test_extensions/management/commands/test.py +++ b/src/test_extensions/management/commands/test.py @@ -79,7 +79,17 @@ def handle(self, *test_labels, **options): #print test_runner # print test_runner.__file__ + if hasattr(settings, 'SKIP_TESTS'): + if not test_labels: + test_labels = list() + for app in settings.INSTALLED_APPS: + test_labels.append(app.split('.')[-1]) + for app in settings.SKIP_TESTS: + try: + test_labels.remove(app) + except ValueError: + pass failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive) # , skip_apps=skippers) if failures: - sys.exit(failures) \ No newline at end of file + sys.exit(failures)