Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #16490 -- Skipped a test failure that only occurs under Python …

…2.6.1 (it's the old iteration-eats-exceptions problem).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 161c6328a0811280926a16275be5ef4164f5866f 1 parent 05e2971
Russell Keith-Magee authored September 10, 2011
12  tests/modeltests/select_for_update/tests.py
@@ -101,10 +101,11 @@ def test_for_update_sql_generated_nowait(self):
101 101
     # are swallowed (Python issue 1242657), so these cases return an empty
102 102
     # list, rather than raising an exception. Not a lot we can do about that,
103 103
     # unfortunately, due to the way Python handles list() calls internally.
104  
-    # Thus, we skip this test for Python 2.6.
  104
+    # Python 2.6.1 is the "in the wild" version affected by this, so we skip
  105
+    # the test for that version.
105 106
     @requires_threading
106 107
     @skipUnlessDBFeature('has_select_for_update_nowait')
107  
-    @unittest.skipIf(sys.version_info[:2] == (2, 6), "Python version is 2.6")
  108
+    @unittest.skipIf(sys.version_info[:3] == (2, 6, 1), "Python version is 2.6.1")
108 109
     def test_nowait_raises_error_on_block(self):
109 110
         """
110 111
         If nowait is specified, we expect an error to be raised rather
@@ -124,8 +125,15 @@ def test_nowait_raises_error_on_block(self):
124 125
         self.end_blocking_transaction()
125 126
         self.check_exc(status[-1])
126 127
 
  128
+    # In Python 2.6 beta and some final releases, exceptions raised in __len__
  129
+    # are swallowed (Python issue 1242657), so these cases return an empty
  130
+    # list, rather than raising an exception. Not a lot we can do about that,
  131
+    # unfortunately, due to the way Python handles list() calls internally.
  132
+    # Python 2.6.1 is the "in the wild" version affected by this, so we skip
  133
+    # the test for that version.
127 134
     @skipIfDBFeature('has_select_for_update_nowait')
128 135
     @skipUnlessDBFeature('has_select_for_update')
  136
+    @unittest.skipIf(sys.version_info[:3] == (2, 6, 1), "Python version is 2.6.1")
129 137
     def test_unsupported_nowait_raises_error(self):
130 138
         """
131 139
         If a SELECT...FOR UPDATE NOWAIT is run on a database backend

0 notes on commit 161c632

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