Skip to content

Commit 3d68796

Browse files
committed
Fix the command to run tests in tox.ini
1 parent f6891a2 commit 3d68796

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

runtests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
This file is required to run Django tests in tox.
55
Based on http://joebergantine.com/articles/reusable-django-application-travis-tox/
66
"""
7+
78
import os
89
import sys
910
import django
@@ -13,13 +14,13 @@
1314

1415

1516
def runtests():
16-
os.environ['DJANGO_SETTINGS_MODULE'] = 'cspreports.tests.settings'
17+
os.environ["DJANGO_SETTINGS_MODULE"] = "cspreports.tests.settings"
1718
django.setup()
1819
TestRunner = get_runner(settings)
1920
test_runner = TestRunner()
20-
failures = test_runner.run_tests(['cspreports'])
21+
failures = test_runner.run_tests(["cspreports"])
2122
sys.exit(bool(failures))
2223

2324

24-
if __name__ == '__main__':
25+
if __name__ == "__main__":
2526
runtests()

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ deps =
2020
50: django >= 5.0, <5.3
2121
extras = test
2222
passenv = CI,TRAVIS,TRAVIS_*
23-
setenv = DJANGO_SETTINGS_MODULE = cspreports.tests.settings
2423
commands =
25-
coverage run --branch --source=cspreports setup.py test
24+
coverage run --branch --source=cspreports runtests.py
2625
codecov
2726

2827
# Specific environments

0 commit comments

Comments
 (0)