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
Copy file name to clipboardExpand all lines: README.md
+22-20Lines changed: 22 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,7 +189,28 @@ Default client fixture names the plugin will look for (in order):
189
189
190
190
If you use a different fixture name, you can provide one or more names via the CLI flag `--api-cov-client-fixture-names` (repeatable) or in `pyproject.toml` under `[tool.pytest_api_cov]` as `client_fixture_names` (a list).
191
191
192
-
#### Option 1: Helper Function
192
+
193
+
#### Option 1: Configuration-Based (recommended for most users)
194
+
195
+
Configure one or more existing fixture names to be discovered and wrapped automatically by the plugin.
196
+
197
+
Example `pyproject.toml`:
198
+
199
+
```toml
200
+
[tool.pytest_api_cov]
201
+
# Provide a list of candidate fixture names the plugin should try (order matters)
If the configured fixture(s) are not found, the plugin will try to use an `app` fixture (if present) to create a tracked client. If neither is available or the plugin cannot extract the app from a discovered client fixture, the tests will still run — coverage will simply be unavailable and a warning will be logged.
212
+
213
+
#### Option 2: Helper Function
193
214
194
215
Use the `create_coverage_fixture` helper to create a custom fixture name:
If the configured fixture(s) are not found, the plugin will try to use an `app` fixture (if present) to create a tracked client. If neither is available or the plugin cannot extract the app from a discovered client fixture, the tests will still run — coverage will simply be unavailable and a warning will be logged.
0 commit comments