Ticket #6168: runtests_bug.2.diff

File runtests_bug.2.diff, 903 bytes (added by floguy, 10 years ago)

Fixed the real problem. The tests were getting added just fine, but "test_labels" was still getting passed in along with the other apps. When the test runner attempted to import the "invalid_models" app, then everything crashed and burned. Simply removing that entry from test_labels keeps all other functionality intact while fixing the problem at hand.

  • tests/runtests.py

    118118    get_apps()
    120120    # Load all the test model apps.
    121     test_models = []
    122121    for model_dir, model_name in get_test_models():
    123122        model_label = '.'.join([model_dir, model_name])
    124123        try:
    142141        model_label = '.'.join([model_dir, model_name])
    143142        if not test_labels or model_name in test_labels:
    144143            extra_tests.append(InvalidModelTestCase(model_label))
     145    # "invalid_models" is not an app, so we cannot pass it in with the other
     146    # test_labels
     147    try:
     148        test_labels.remove("invalid_models")
     149    except ValueError:
     150        pass
    146152    # Run the test suite, including the extra validation tests.
    147153    from django.test.simple import run_tests
Back to Top