]> granicus.if.org Git - python/commitdiff
test01_join(): Fix a test failure when run with "python -O". The
authorBarry Warsaw <barry@python.org>
Mon, 21 Jul 2003 18:43:33 +0000 (18:43 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 21 Jul 2003 18:43:33 +0000 (18:43 +0000)
setting of sCursor happened in an assert.

Lib/bsddb/test/test_join.py

index f434c541b2289c3f3c364f190dcdf3a8c143d174..838ffe75900978fa145c675197a158bfb2b9e4aa 100644 (file)
@@ -85,7 +85,10 @@ class JoinTestCase(unittest.TestCase):
         try:
             # lets look up all of the red Products
             sCursor = secDB.cursor()
-            assert sCursor.set('red')
+            # Don't do the .set() in an assert, or you can get a bogus failure
+            # when running python -O
+            tmp = sCursor.set('red')
+            assert tmp
 
             # FIXME: jCursor doesn't properly hold a reference to its
             # cursors, if they are closed before jcursor is used it