Code

Ticket #12658: 12658.diff

File 12658.diff, 814 bytes (added by schinckel, 4 years ago)

Fix for syntax/import errors causing tests to be skipped.

Line 
1Index: django/test/simple.py
2===================================================================
3--- django/test/simple.py       (revision 12267)
4+++ django/test/simple.py       (working copy)
5@@ -72,9 +72,12 @@
6         from imp import find_module
7         try:
8             mod = find_module(TEST_MODULE, [os.path.dirname(app_module.__file__)])
9-        except ImportError:
10-            # 'tests' module doesn't exist. Move on.
11-            test_module = None
12+        except ImportError, f:
13+            if f.args == e.args:
14+                # 'tests' module doesn't exist. Move on.
15+                test_module = None
16+            else:
17+                raise e
18         else:
19             # The module exists, so there must be an import error in the
20             # test module itself. We don't need the module; so if the