summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2014-11-16 02:01:45 +0100
committerTim Graham <timograham@gmail.com>2014-11-21 11:41:13 -0500
commit8330b50c8587fc5484650f5bf47a3f03b50fb2ca (patch)
treeb771a578e9cca413fe7eb095867c1c93551502d7
parent72729f844e0dd9bd01b3874171b89ab0d136a40e (diff)
Fixed #23863 -- Made runtests accept the keepdb option.
refs #20550
-rwxr-xr-xtests/runtests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index 8f612c80ec..0387a1c0a3 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -198,7 +198,7 @@ def teardown(state):
setattr(settings, key, value)
-def django_tests(verbosity, interactive, failfast, test_labels):
+def django_tests(verbosity, interactive, failfast, keepdb, test_labels):
state = setup(verbosity, test_labels)
extra_tests = []
@@ -211,6 +211,7 @@ def django_tests(verbosity, interactive, failfast, test_labels):
verbosity=verbosity,
interactive=interactive,
failfast=failfast,
+ keepdb=keepdb,
)
# Catch warnings thrown in test DB setup -- remove in Django 1.9
with warnings.catch_warnings():
@@ -347,6 +348,9 @@ if __name__ == "__main__":
help='Tells Django to stop running the test suite after first failed '
'test.')
parser.add_argument(
+ '-k', '--keepdb', action='store_true', dest='keepdb', default=False,
+ help='Tells Django to preserve the test database between runs.')
+ parser.add_argument(
'--settings',
help='Python path to settings module, e.g. "myproject.settings". If '
'this isn\'t provided, either the DJANGO_SETTINGS_MODULE '
@@ -388,6 +392,7 @@ if __name__ == "__main__":
paired_tests(options.pair, options, options.modules)
else:
failures = django_tests(options.verbosity, options.interactive,
- options.failfast, options.modules)
+ options.failfast, options.keepdb,
+ options.modules)
if failures:
sys.exit(bool(failures))