Skip to content

Commit c55e55b

Browse files
author
Joachim Jablon
committed
Saner test command
1 parent da845f3 commit c55e55b

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ lint: ## check style with flake8
2020
flake8 django_readonly_field tests
2121

2222
test: ## run tests quickly with the default Python
23-
python runtests.py tests
23+
python runtests.py
2424

2525
test-all: ## run tests on every Python version with tox
2626
tox
2727

2828
coverage: ## check code coverage quickly with the default Python
29-
coverage run --source django_readonly_field runtests.py tests
29+
coverage run --source django_readonly_field runtests.py
3030
coverage report -m
3131
coverage html
3232

runtests.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,8 @@
1717

1818

1919
def run_tests(*test_args):
20-
if not test_args:
21-
test_args = ['tests']
22-
23-
# Run tests
24-
TestRunner = get_runner(settings)
25-
test_runner = TestRunner()
26-
27-
failures = test_runner.run_tests(test_args)
28-
29-
if failures:
30-
sys.exit(bool(failures))
20+
from django.core.management import execute_from_command_line
21+
execute_from_command_line(["", "test", ] + sys.argv[1:])
3122

3223

3324
if __name__ == '__main__':

0 commit comments

Comments
 (0)