Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make run_tests a function to make it fully backwards compatible

  • Loading branch information...
commit 0a96055a08b27d195920ad88141676b02937e029 1 parent b4c292a
Joaquín Cuenca Abela e98cuenc authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 django_pytest/test_runner.py
11 django_pytest/test_runner.py
View
@@ -4,7 +4,7 @@ def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
self.interactive = interactive
self.failfast = failfast
- def run_tests(self, test_labels):
+ def run_tests(self, test_labels, extra_tests=None):
import pytest
import sys
@@ -14,6 +14,11 @@ def run_tests(self, test_labels):
'requires.')
exit(1)
+ if extra_tests:
+ print ('Not yet implemented: py.test is still not able to '
+ 'run extra_tests as Django requires.')
+ exit(1)
+
pytest_args = []
if self.failfast:
pytest_args.append('--exitfirst')
@@ -34,6 +39,6 @@ def run_tests(self, test_labels):
# Keep the old name to be backwards-compatible
-def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
+def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=None):
runner = TestRunner(verbosity, interactive, failfast=False)
- runner.run_tests(test_labels)
+ runner.run_tests(test_labels, extra_tests)
Please sign in to comment.
Something went wrong with that request. Please try again.