Created
December 16, 2013 16:48
-
-
Save joequery/7990173 to your computer and use it in GitHub Desktop.
testing django apps using django_discover_runner. Allows you to specify paths so you can use linux file autocompletion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| import subprocess | |
| if len(sys.argv) != 2: | |
| exit("Improper usage. Do pytest test/path/to/tests.someTestCase.some_test") | |
| command_list = ["python", "manage.py", "test"] | |
| test_path = sys.argv[1].replace("/", ".") | |
| command_list.append(test_path) | |
| subprocess.call(command_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment