Commit d919f64
Re-export parse_address and migrate fork-guard tests to pid-cache patch
Three small cycle-21 follow-ups:
- ``parse_address`` was promoted to public in cycle 21 but never added
to ``dqliteclient.__init__.py``'s ``__all__``. Cross-package
consumers still had to reach into ``dqliteclient.connection``,
re-introducing the cross-package private-API drift the rename was
meant to close. Re-export it.
- Fork-guard tests across the client and dbapi patched
``dqliteclient.connection.os.getpid``, ``dqliteclient.pool.os.getpid``,
``dqliteclient.cluster.os.getpid``, ``dqlitedbapi.connection.os.getpid``,
and ``dqlitedbapi.aio.connection.os.getpid``. Cycle 21 moved every
hot-path pid check from ``os.getpid()`` to a cached module attribute
(``dqliteclient.connection._current_pid``) refreshed by
``os.register_at_fork``. The patches were dead code — the tests
passed only because they also mutated ``_creator_pid`` directly.
Migrate every patch to ``patch("dqliteclient.connection._current_pid", ...)``
so the test exercises the production read path it claims to.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9837cff commit d919f64
5 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
0 commit comments