Remove flaky source-text oracle test (issue #7726)
test_delete_cli_session_still_opens_writable_connection asserted on inspect.getsource(models.delete_cli_session) text, so it failed only in single-process full-suite runs when an earlier test leaves a monkeypatched/decorated wrapper bound on api.models. The writable-connection contract is already covered end to end by tests/test_issue1494_state_db_fd_leak.py::test_delete_cli_session_closes_connection, which performs a real delete and asserts the rows are gone. Remove the source oracle without a textual replacement; keep a short comment pointing at the behavioral coverage.
This commit is contained in:
1 parent
18db77a132
commit
26702fd19f
1 file changed
+2
-19
@@ -253,22 +253,5 @@ def test_read_only_handle_rejects_writes(tmp_path):
|
|||||||
raise AssertionError("read-only handle unexpectedly allowed a write")
|
raise AssertionError("read-only handle unexpectedly allowed a write")
|
||||||
except sqlite3.OperationalError:
|
except sqlite3.OperationalError:
|
||||||
pass
|
pass
|
||||||
|
# The delete path's writable-connection contract is covered behaviorally by
|
||||||
|
# tests/test_issue1494_state_db_fd_leak.py::test_delete_cli_session_closes_connection.
|
||||||
def test_delete_cli_session_still_opens_writable_connection():
|
|
||||||
"""The lone write path (a DELETE) must keep a writable connection — a
|
|
||||||
read-only downgrade would make the delete silently no-op."""
|
|
||||||
import inspect
|
|
||||||
|
|
||||||
src = "\n".join(
|
|
||||||
(
|
|
||||||
inspect.getsource(models.delete_cli_session),
|
|
||||||
inspect.getsource(models._delete_cli_session_locked),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
assert "sqlite3.connect(str(db_path))" in src, (
|
|
||||||
"delete_cli_session must keep its writable connection"
|
|
||||||
)
|
|
||||||
assert "open_state_db_readonly" not in src, (
|
|
||||||
"delete_cli_session must not be downgraded to the read-only helper"
|
|
||||||
)
|
|
||||||
Reference in new issue
Block a user