| 635 | real_con = reader._con |
| 636 | |
| 637 | class _RaceCon: |
| 638 | def execute(self, sql: str) -> object: # noqa: PLR6301 |
| 639 | if sql.lstrip().upper().startswith("SELECT") and not writer._con.in_transaction: |
| 640 | writer.acquire_write() # writer slips in between the reader's BEGIN and SELECT |
| 641 | return real_con.execute(sql) |
| 642 | |
| 643 | def __getattr__(self, name: str) -> object: |
| 644 | return getattr(real_con, name) |
| 645 | |
| 646 | reader._con = _RaceCon() # ty: ignore[invalid-assignment] |
| 647 | with pytest.raises(Timeout): |
no outgoing calls
searching dependent graphs…