Test that setting the progress handler to None clears the previously set handler.
(self)
| 182 | "create table bar (a, b)") |
| 183 | |
| 184 | def test_clear_handler(self): |
| 185 | """ |
| 186 | Test that setting the progress handler to None clears the previously set handler. |
| 187 | """ |
| 188 | con = self.con |
| 189 | action = 0 |
| 190 | def progress(): |
| 191 | nonlocal action |
| 192 | action = 1 |
| 193 | return 0 |
| 194 | con.set_progress_handler(progress, 1) |
| 195 | con.set_progress_handler(None, 1) |
| 196 | con.execute("select 1 union select 2 union select 3").fetchall() |
| 197 | self.assertEqual(action, 0, "progress handler was not cleared") |
| 198 | |
| 199 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 200 | @with_tracebacks(ZeroDivisionError, msg_regex="bad_progress") |
nothing calls this directly
no test coverage detected