Ticket #13873: TEST_SKIP_APP_TESTS.diff
File TEST_SKIP_APP_TESTS.diff, 4.1 KB (added by , 14 years ago) |
---|
-
django/test/simple.py
244 244 app = get_app(label) 245 245 suite.addTest(build_suite(app)) 246 246 else: 247 for app in get_apps(): 248 suite.addTest(build_suite(app)) 247 for app_name in settings.INSTALLED_APPS: 248 if app_name not in settings.TEST_SKIP_APP_TESTS: 249 app = get_app(app_name.split('.')[-1]) 250 suite.addTest(build_suite(app)) 249 251 250 252 if extra_tests: 251 253 for test in extra_tests: -
django/conf/global_settings.py
515 515 TEST_DATABASE_CHARSET = None 516 516 TEST_DATABASE_COLLATION = None 517 517 518 # A list of INSTALLED_APPs that should (by default) be skipped when running the tests. 519 TEST_SKIP_APP_TESTS = () 520 518 521 ############ 519 522 # FIXTURES # 520 523 ############ -
tests/regressiontests/skip_these_tests/tests.py
1 """ 2 These are tests that should never run as they are included in the TEST_SKIP_APP_TESTS 3 """ 4 5 from django.test import TestCase 6 7 class SkipTheseTests(TestCase): 8 9 def test_this_test_should_be_skipped(self): 10 """ 11 This test should never run as the app is registered in TEST_SKIP_APP_TESTS 12 """ 13 self.fail( 14 "This test should never run as the app (modeltests.skip_these_tests) "\ 15 "is registered in TEST_SKIP_APP_TESTS" 16 ) 17 -
tests/runtests.py
88 88 from django.conf import settings 89 89 90 90 old_installed_apps = settings.INSTALLED_APPS 91 old_skip_app_tests = settings.TEST_SKIP_APP_TESTS 91 92 old_root_urlconf = getattr(settings, "ROOT_URLCONF", "") 92 93 old_template_dirs = settings.TEMPLATE_DIRS 93 94 old_use_i18n = settings.USE_I18N … … 97 98 98 99 # Redirect some settings for the duration of these tests. 99 100 settings.INSTALLED_APPS = ALWAYS_INSTALLED_APPS 101 settings.TEST_SKIP_APP_TESTS = ('regressiontests.skip_these_tests',) 100 102 settings.ROOT_URLCONF = 'urls' 101 103 settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), TEST_TEMPLATE_DIR),) 102 104 settings.USE_I18N = True … … 176 178 177 179 # Restore the old settings. 178 180 settings.INSTALLED_APPS = old_installed_apps 181 settings.TEST_SKIP_APP_TESTS = old_skip_app_tests 179 182 settings.ROOT_URLCONF = old_root_urlconf 180 183 settings.TEMPLATE_DIRS = old_template_dirs 181 184 settings.USE_I18N = old_use_i18n -
docs/ref/settings.txt
387 387 388 388 See :ref:`topics-testing`. 389 389 390 TEST_SKIP_APP_TESTS 391 ~~~~~~~~~ 390 392 393 Default: ``()`` (Empty tuple) 394 395 A tuple of strings designating all applications that should be skipped 396 when running tests. Each string should be a full Python path to a Python 397 package that contains a Django application. Use this setting to exclude 398 any thirdparty applications that are listed in :setting:`INSTALLED_APPS` 399 that should not be tested as part of your normal workflow. Note that 400 if you specify a set of applications as command line arguments to the test 401 command, they will not be excluded even if they are listed here. 402 391 403 .. setting:: DATABASE_ROUTERS 392 404 393 405 DATABASE_ROUTERS