test_map
mkdocs_terok.test_map
¶
Generate a Markdown test map from pytest collection.
Runs pytest --collect-only -qq on an integration test directory and
groups the collected test IDs by subdirectory, producing Markdown tables
with optional marker extraction and CI tier columns.
TestMapConfig
dataclass
¶
Configuration for test map generation.
Attributes:
| Name | Type | Description |
|---|---|---|
root |
Path
|
Project root directory. |
integration_dir |
Path | None
|
Integration test directory. Defaults to
|
dir_order |
Sequence[str]
|
Canonical ordering for known test subdirectories. |
show_markers |
bool
|
Include CI tier and marker columns in the output. |
title |
str
|
Page title for the generated Markdown. |
Source code in src/mkdocs_terok/test_map.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
resolved_integration_dir
property
¶
Return the integration test directory, with fallback to default.
collect_tests(*, config=None)
¶
Run pytest --collect-only and return the list of test node IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
TestMapConfig | None
|
Test map configuration. Uses defaults if |
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If pytest collection fails (non-zero exit code). |
Source code in src/mkdocs_terok/test_map.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
generate_test_map(test_ids=None, *, config=None)
¶
Generate a Markdown test map grouped by directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
test_ids
|
list[str] | None
|
Optional pre-collected test IDs. If |
None
|
config
|
TestMapConfig | None
|
Configuration for the test map. Uses defaults if |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Markdown string with the test map. |
Source code in src/mkdocs_terok/test_map.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |