Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: allow to specify args, e.g. a single test to run #155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth updating the README too? There's a section on running tests.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down