Ticket #12932: django_12932.diff

File django_12932.diff, 2.8 KB (added by Eric Holscher, 15 years ago)
  • django/test/simple.py

    diff --git a/django/test/simple.py b/django/test/simple.py
    index a64ed96..0fc154f 100644
    a b def reorder_suite(suite, classes):  
    232232
    233233
    234234class DjangoTestSuiteRunner(object):
    235     def __init__(self, verbosity=1, interactive=True, failfast=True):
     235    def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs):
    236236        self.verbosity = verbosity
    237237        self.interactive = interactive
    238238        self.failfast = failfast
    239239
    240     def setup_test_environment(self):
     240    def setup_test_environment(self, **kwargs):
    241241        setup_test_environment()
    242242        settings.DEBUG = False
    243243
    244     def build_suite(self, test_labels, extra_tests=None):
     244    def build_suite(self, test_labels, extra_tests=None, **kwargs):
    245245        suite = unittest.TestSuite()
    246246
    247247        if test_labels:
    class DjangoTestSuiteRunner(object):  
    261261
    262262        return reorder_suite(suite, (TestCase,))
    263263
    264     def setup_databases(self):
     264    def setup_databases(self, **kwargs):
    265265        from django.db import connections
    266266        old_names = []
    267267        mirrors = []
    class DjangoTestSuiteRunner(object):  
    278278                connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
    279279        return old_names, mirrors
    280280
    281     def run_suite(self, suite):
     281    def run_suite(self, suite, **kwargs):
    282282        return DjangoTestRunner(verbosity=self.verbosity, failfast=self.failfast).run(suite)
    283283
    284     def teardown_databases(self, old_config):
     284    def teardown_databases(self, old_config, **kwargs):
    285285        from django.db import connections
    286286        old_names, mirrors = old_config
    287287        # Point all the mirrors back to the originals
    class DjangoTestSuiteRunner(object):  
    291291        for connection, old_name in old_names:
    292292            connection.creation.destroy_test_db(old_name, self.verbosity)
    293293
    294     def teardown_test_environment(self):
     294    def teardown_test_environment(self, **kwargs):
    295295        teardown_test_environment()
    296296
    297     def suite_result(self, result):
     297    def suite_result(self, suite, result, **kwargs):
    298298        return len(result.failures) + len(result.errors)
    299299
    300     def run_tests(self, test_labels, extra_tests=None):
     300    def run_tests(self, test_labels, extra_tests=None, **kwargs):
    301301        """
    302302        Run the unit tests for all the test labels in the provided list.
    303303        Labels must be of the form:
    class DjangoTestSuiteRunner(object):  
    322322        result = self.run_suite(suite)
    323323        self.teardown_databases(old_config)
    324324        self.teardown_test_environment()
    325         return self.suite_result(result)
     325        return self.suite_result(suite, result)
    326326
    327327def run_tests(test_labels, verbosity=1, interactive=True, failfast=False, extra_tests=None):
    328328    import warnings
Back to Top