summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-09-10 18:44:33 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-09-10 18:44:33 +0000
commit161c6328a0811280926a16275be5ef4164f5866f (patch)
tree4b710ce2739f0e2856f026b97460388392384201
parent05e29716b446f71eef8318f8093f0c19726ae22f (diff)
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
-rw-r--r--tests/modeltests/select_for_update/tests.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/modeltests/select_for_update/tests.py b/tests/modeltests/select_for_update/tests.py
index 643b0852d6..f8b7bba0cb 100644
--- a/tests/modeltests/select_for_update/tests.py
+++ b/tests/modeltests/select_for_update/tests.py
@@ -101,10 +101,11 @@ class SelectForUpdateTests(TransactionTestCase):
# are swallowed (Python issue 1242657), so these cases return an empty
# list, rather than raising an exception. Not a lot we can do about that,
# unfortunately, due to the way Python handles list() calls internally.
- # Thus, we skip this test for Python 2.6.
+ # Python 2.6.1 is the "in the wild" version affected by this, so we skip
+ # the test for that version.
@requires_threading
@skipUnlessDBFeature('has_select_for_update_nowait')
- @unittest.skipIf(sys.version_info[:2] == (2, 6), "Python version is 2.6")
+ @unittest.skipIf(sys.version_info[:3] == (2, 6, 1), "Python version is 2.6.1")
def test_nowait_raises_error_on_block(self):
"""
If nowait is specified, we expect an error to be raised rather
@@ -124,8 +125,15 @@ class SelectForUpdateTests(TransactionTestCase):
self.end_blocking_transaction()
self.check_exc(status[-1])
+ # In Python 2.6 beta and some final releases, exceptions raised in __len__
+ # are swallowed (Python issue 1242657), so these cases return an empty
+ # list, rather than raising an exception. Not a lot we can do about that,
+ # unfortunately, due to the way Python handles list() calls internally.
+ # Python 2.6.1 is the "in the wild" version affected by this, so we skip
+ # the test for that version.
@skipIfDBFeature('has_select_for_update_nowait')
@skipUnlessDBFeature('has_select_for_update')
+ @unittest.skipIf(sys.version_info[:3] == (2, 6, 1), "Python version is 2.6.1")
def test_unsupported_nowait_raises_error(self):
"""
If a SELECT...FOR UPDATE NOWAIT is run on a database backend