From 09e53aec99b8fe846a57916da746bb9df66fd327 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 13 Jun 2018 13:15:07 +0200 Subject: [PATCH] tests: allow to specify args, e.g. a single test to run This allows for tox -e py36-django111 -- tests.test_backend.SESBackendTest.test_dkim_mail --- runtests.py | 4 +++- tox.ini | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtests.py b/runtests.py index 8f2bf8d7..3572e11a 100644 --- a/runtests.py +++ b/runtests.py @@ -12,6 +12,8 @@ # `DATABASES` value be present and configured in order to # do anything. +import sys + import django from django.conf import settings from django.core.management import call_command @@ -34,4 +36,4 @@ django.setup() # Start the test suite now that the settings are configured. -call_command("test", "tests") +call_command("test", *sys.argv[1:]) diff --git a/tox.ini b/tox.ini index 08bcc591..20b18e01 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = django{18,19,110,111} [testenv] commands = - python runtests.py + python runtests.py {posargs:tests} deps = mock django18: Django>=1.8,<1.9