diff options
author | Petri Lehtinen <petri@digip.org> | 2012-02-17 19:34:41 (GMT) |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2012-02-17 19:34:45 (GMT) |
commit | 437b149b0cb91f6bd8e42e8d945637ae69e57a2d (patch) | |
tree | f3d4a6db9e67a715d723c5c067409e0638b9fe9e /Lib | |
parent | e6010061fca5cae4483b9f7ffab9d955343a20fe (diff) | |
download | cpython-437b149b0cb91f6bd8e42e8d945637ae69e57a2d.zip cpython-437b149b0cb91f6bd8e42e8d945637ae69e57a2d.tar.gz cpython-437b149b0cb91f6bd8e42e8d945637ae69e57a2d.tar.bz2 |
Fix a variable scoping error in an sqlite3 test
Initial patch by Torsten Landschoff.
Closes #11689.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/sqlite3/test/hooks.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py index 2745c8b..b798e74 100644 --- a/Lib/sqlite3/test/hooks.py +++ b/Lib/sqlite3/test/hooks.py @@ -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") |