Skip to content

Commit ab9717e

Browse files
docs: Refine parallelism settings and testing customization guidelines
- Updated `AGENTS.md` with `pytest -n auto` to simplify parallel test configuration. - Enhanced guidance for endpoint/server option testing: - Unit tests for `extra_query`, `extra_headers`, `extra_body`, and `timeout`. - Live tests only required for server-observable effects. - Expanded `TESTING_GUIDELINES.md` to clarify customization validation. - Mocked tests handle request customization. - Live tests validate server-specific behaviors when applicable. Assisted-by: Codex
1 parent b4ffd47 commit ab9717e

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- `uvx nox -s tests` — create matrix virtualenvs via nox and execute the pytest
2424
session.
2525
- `nox` executes pytest sessions with built-in parallelism; when invoking pytest
26-
directly use `pytest -n 8 --maxschedchunk 2` to mirror the parallel test
26+
directly use `pytest -n auto --maxschedchunk 2` to mirror the parallel test
2727
scheduling and keep runtimes predictable.
2828
- Coverage reports (XML/Markdown/HTML) are produced by the nox `tests` session
2929
and stored under `coverage/py<version>/` (for example,
@@ -134,7 +134,9 @@
134134
considered complete. Mirror the naming/structure used by the graphic
135135
conversion suites: one module per endpoint, parameterized success cases that
136136
enumerate all accepted literals, at least one invalid input that hits the
137-
server, and coverage for any request options surfaced on the client. If an
137+
server, and coverage for server-observable endpoint options. Validate
138+
`extra_query`/`extra_headers`/`extra_body`/`timeout` plumbing in unit tests
139+
(MockTransport) unless a live assertion depends on those options. If an
138140
endpoint cannot be exercised live, call that out explicitly in the PR
139141
description with the reason and the follow-up plan; otherwise reviewers should
140142
block the change. Treat this as a release gate on par with unit tests.

TESTING_GUIDELINES.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,22 @@ iteration required.
201201
predictable. Use `pytest.fixture(scope="module"/"class")` and
202202
`pytest_asyncio.fixture` to cache uploaded PDFs/profiles for both transports.
203203
- **Sync + async parity:** Every live module should contain matching sync and
204-
async tests for success, customization, streaming, and invalid paths
205-
(compression levels, conversion options, file streaming helpers).
204+
async tests for success, streaming, and invalid paths (compression levels,
205+
conversion options, file streaming helpers). Treat transport-plumbing
206+
customization (`extra_query`, `extra_headers`, `extra_body`, `timeout`) as a
207+
unit-test responsibility unless the endpoint exposes server-observable
208+
behavior tied to those options.
206209
- **Enumerate literals:** Parameterize over every accepted literal (compression
207210
levels, `color_model`, `smoothing`, merge selectors, redaction presets). Each
208211
literal should hit the server once per transport.
209212
- **Optional arguments:** Exercise options such as custom output prefixes,
210213
diagnostics toggles, merge metadata, and URL uploads. Validate the server
211214
honors them (filenames start with the user-provided prefix, warnings appear
212215
when expected).
216+
- **Customization placement:** Verify request customization wiring in mocked
217+
tests (sync + async) for each endpoint. Live customization tests are optional
218+
and should be added only when they validate server-side behavior beyond client
219+
request assembly.
213220
- **Negative live cases:** Override JSON via `extra_body`/`extra_query` to
214221
bypass local validation and assert `PdfRestApiError` (or the exact server
215222
exception) surfaces—for example, sending an invalid compression literal or

0 commit comments

Comments
 (0)