diff options
| author | Justin Bronn <jbronn@gmail.com> | 2009-04-19 23:07:24 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2009-04-19 23:07:24 +0000 |
| commit | be11bd40d417331944a2fbf6f2d7b4e2e72680cf (patch) | |
| tree | 9bff59dabc8d0ce1231df750bb2b1dd4b8be1a93 | |
| parent | aeaba06bf4976cca2d97f7a39de86a385f6af777 (diff) | |
Fixed #10832 -- now use `reorder_suite` in GeoDjango test runner, thanks seanl for ticket & patch; restored original ordering of GEOS tests, as placing last no longer necessary.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/gis/tests/__init__.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/django/contrib/gis/tests/__init__.py b/django/contrib/gis/tests/__init__.py index 566dc4f423..f0305f994f 100644 --- a/django/contrib/gis/tests/__init__.py +++ b/django/contrib/gis/tests/__init__.py @@ -1,4 +1,5 @@ import sys, unittest +from django.test.simple import reorder_suite, TestCase from django.utils.importlib import import_module def geo_suite(): @@ -16,6 +17,10 @@ def geo_suite(): # The test suite. s = unittest.TestSuite() + # Adding the GEOS tests. + from django.contrib.gis.geos import tests as geos_tests + s.addTest(geos_tests.suite()) + # Tests that require use of a spatial database (e.g., creation of models) test_apps = ['geoapp', 'relatedapp'] @@ -48,14 +53,6 @@ def geo_suite(): tsuite = import_module('django.contrib.gis.tests.' + suite_name) s.addTest(tsuite.suite()) - # Adding the GEOS tests _last_. Doing this because if suite starts - # immediately with this test while after running syncdb, it will cause a - # segmentation fault. My initial guess is that SpatiaLite is still in - # critical areas of non thread-safe GEOS code when the test suite is run. - # TODO: Confirm my reasoning. Are there other consequences? - from django.contrib.gis.geos import tests as geos_tests - s.addTest(geos_tests.suite()) - return s, test_apps def run_gis_tests(test_labels, **kwargs): @@ -158,6 +155,8 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite= for test in extra_tests: suite.addTest(test) + suite = reorder_suite(suite, (TestCase,)) + # Executing the tests (including the model tests), and destorying the # test database after the tests have completed. result = unittest.TextTestRunner(verbosity=verbosity).run(suite) |
