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
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
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
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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |