(real_connection: sqlite3.Connection, statement: str)
| 188 | seen_in_transaction: list[bool] = [] |
| 189 | |
| 190 | def execute(real_connection: sqlite3.Connection, statement: str) -> sqlite3.Cursor: |
| 191 | nonlocal busy_once |
| 192 | if statement == "BEGIN TRANSACTION": |
| 193 | seen_in_transaction.append(real_connection.in_transaction) |
| 194 | if "SELECT name" in statement and busy_once: |
| 195 | # A writer can take the lock between the deferred BEGIN and the SELECT that needs the shared lock. |
| 196 | busy_once = False |
| 197 | raise _busy_error() |
| 198 | return real_connection.execute(statement) |
| 199 | |
| 200 | patch_connection(mocker, execute=execute) |
| 201 | # With other threads alive the acquire waits in short slices that never reach the in-place retry under test. |
nothing calls this directly
no test coverage detected