You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a0580c6
Browse filesBrowse the repository at this point in the historyBrowse files
docs(testing): describe time's in-process harness and coverage command
The skill still said no Python test opens a ClientSession, that time lacks
pytest-asyncio, and that no Python server has coverage tooling; this PR
made all three false for time.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
Copy file name to clipboardExpand all lines: .claude/skills/testing/SKILL.md
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,10 @@ Driving a running server by hand, with the Inspector or an LLM client, is
16
16
`/client-smoke`. It is evidence for a PR, not a substitute for a test.
17
17
18
18
⚠️ **The harnesses are uneven, and this page describes them as they are.** Only
19
-
`everything` can be driven in-process today. A shared in-process harness for
20
-
every server, and a per-file coverage threshold, are the work of #4854
21
-
(TypeScript) and #4855 (Python); neither exists yet, and this skill changes
22
-
when they land. Do not write a test that assumes them.
19
+
`everything`and `time`can be driven in-process today. A shared in-process
20
+
harness for every server, and an enforced per-file coverage threshold, are the
21
+
work of #4854(TypeScript) and #4855 (Python); neither is complete yet, and
22
+
this skill changes when they land. Do not write a test that assumes them.
23
23
24
24
## Where a test goes
25
25
@@ -42,10 +42,10 @@ helpers go in `__tests__/` without the `.test` suffix, as
42
42
|`filesystem`| Unit tests of `lib.ts` and the path helpers, plus an SDK `Client` over `StdioClientTransport` that spawns the built `dist/index.js`|
43
43
|`sequentialthinking`| Unit tests of `lib.ts`, plus an SDK `Client` over stdio against `dist/index.js`|
44
44
|`memory`| Direct calls on the exported `KnowledgeGraphManager` and `register…` functions, with a mocked server |
45
-
|`fetch`, `git`, `time`| Direct calls on the functions in `server.py`, with `unittest.mock`|
45
+
|`fetch`, `git`| Direct calls on the functions in `server.py`, with `unittest.mock`|
46
+
|`time`| A `ClientSession` against `serve()` in-process, over in-memory streams (`tests/test_protocol.py`); direct calls on the helpers in `server.py` (`tests/test_server.py`) |
46
47
47
-
No test in the repo uses an in-memory transport yet, and no Python test opens
48
-
a `ClientSession`.
48
+
Of the Python servers, only `time` opens a `ClientSession` in its tests.
49
49
50
50
## Choosing a harness for a new test
51
51
@@ -170,8 +170,11 @@ built".
170
170
### Python: `ClientSession` over stdio
171
171
172
172
Each Python server constructs its `Server` inside `serve()`, so it cannot be
173
-
handed to an in-memory session. A protocol-level test spawns the module and
174
-
talks to it through the SDK's stdio client:
173
+
handed to an in-memory session directly. `time` drives it in-process anyway, by
174
+
patching `stdio_server` to yield the server side of
175
+
`create_client_server_memory_streams()`; see the `serving()` helper in
176
+
`src/time/tests/test_protocol.py`. The other route spawns the module and talks
0 commit comments