]> granicus.if.org Git - python/commitdiff
Fix a variable scoping error in an sqlite3 test
authorPetri Lehtinen <petri@digip.org>
Fri, 17 Feb 2012 19:34:41 +0000 (21:34 +0200)
committerPetri Lehtinen <petri@digip.org>
Fri, 17 Feb 2012 19:34:45 +0000 (21:34 +0200)
Initial patch by Torsten Landschoff.

Closes #11689.

Lib/sqlite3/test/hooks.py
Misc/ACKS
Misc/NEWS

index 2745c8b9a9912cfe62c875d9b65d8d8e53f59f07..b798e749add3e3a39dd1cf7160f4a87d23f5be0e 100644 (file)
@@ -166,14 +166,14 @@ class ProgressTests(unittest.TestCase):
         Test that setting the progress handler to None clears the previously set handler.
         """
         con = sqlite.connect(":memory:")
-        action = 0
+        action = []
         def progress():
-            action = 1
+            action.append(1)
             return 0
         con.set_progress_handler(progress, 1)
         con.set_progress_handler(None, 1)
         con.execute("select 1 union select 2 union select 3").fetchall()
-        self.assertEqual(action, 0, "progress handler was not cleared")
+        self.assertEqual(len(action), 0, "progress handler was not cleared")
 
 def suite():
     collation_suite = unittest.makeSuite(CollationTests, "Check")
index caa4c5ba94407888b6b81def897e3365f5d27a5a..57de3d12f567c59634d2e14523b6013f8e949c82 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -475,6 +475,7 @@ Vladimir Kushnir
 Kirill Kuzminykh (Кирилл Кузьминых)
 Ross Lagerwall
 Cameron Laird
+Torsten Landschoff
 Łukasz Langa
 Tino Lange
 Andrew Langmead
index 1b1d02c6faa1b8e55ece42acc993bc9dae32091d..95e4b8688283facf2c760e685638d01f85c72d89 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -526,6 +526,9 @@ Tools/Demos
 Tests
 -----
 
+- Issue #11689: Fix a variable scoping error in an sqlite3 test.
+  Initial patch by Torsten Landschoff.
+
 - Issue #13304: Skip test case if user site-packages disabled (-s or
   PYTHONNOUSERSITE).  (Patch by Carl Meyer)