Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #10832 -- now use `reorder_suite` in GeoDjango test runner, tha…

…nks 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
  • Loading branch information...
commit be11bd40d417331944a2fbf6f2d7b4e2e72680cf 1 parent aeaba06
Justin Bronn authored April 19, 2009

Showing 1 changed file with 7 additions and 8 deletions. Show diff stats Hide diff stats

  1. 15  django/contrib/gis/tests/__init__.py
15  django/contrib/gis/tests/__init__.py
... ...
@@ -1,4 +1,5 @@
1 1
 import sys, unittest
  2
+from django.test.simple import reorder_suite, TestCase
2 3
 from django.utils.importlib import import_module
3 4
 
4 5
 def geo_suite():
@@ -16,6 +17,10 @@ def geo_suite():
16 17
     # The test suite.
17 18
     s = unittest.TestSuite()
18 19
 
  20
+    # Adding the GEOS tests.
  21
+    from django.contrib.gis.geos import tests as geos_tests
  22
+    s.addTest(geos_tests.suite())
  23
+
19 24
     # Tests that require use of a spatial database (e.g., creation of models)
20 25
     test_apps = ['geoapp', 'relatedapp']
21 26
 
@@ -48,14 +53,6 @@ def geo_suite():
48 53
         tsuite = import_module('django.contrib.gis.tests.' + suite_name)
49 54
         s.addTest(tsuite.suite())
50 55
 
51  
-    # Adding the GEOS tests _last_.  Doing this because if suite starts
52  
-    # immediately with this test while after running syncdb, it will cause a
53  
-    # segmentation fault.  My initial guess is that SpatiaLite is still in
54  
-    # critical areas of non thread-safe GEOS code when the test suite is run.
55  
-    # TODO: Confirm my reasoning. Are there other consequences?
56  
-    from django.contrib.gis.geos import tests as geos_tests
57  
-    s.addTest(geos_tests.suite())
58  
-
59 56
     return s, test_apps
60 57
 
61 58
 def run_gis_tests(test_labels, **kwargs):
@@ -158,6 +155,8 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite=
158 155
         for test in extra_tests:
159 156
             suite.addTest(test)
160 157
 
  158
+    suite = reorder_suite(suite, (TestCase,))
  159
+
161 160
     # Executing the tests (including the model tests), and destorying the
162 161
     # test database after the tests have completed.
163 162
     result = unittest.TextTestRunner(verbosity=verbosity).run(suite)

0 notes on commit be11bd4

Please sign in to comment.
Something went wrong with that request. Please try again.