Commit db5e7b1
committed
fix(pytest-plugin[docs]): Fix docs build warnings from autofixtures in eval-rst
why: Two categories of warning were failing docs CI under sphinx-build -W.
(1) _is_markdown_source checked the outer file's .md extension, returning
True even for directives inside {eval-rst} blocks. Those directives use a
docutils RST Body state whose nested_parse is pure RST — passing a
{eval-rst} backtick fence to it caused spurious "Inline literal
start-string without end-string" and "Unexpected indentation" warnings.
The correct check is whether the directive was invoked natively by MyST,
which is detectable via isinstance(directive.state, MockState).
(2) The demo page documented spf_demo_fixtures twice (autofixtures:: block
+ doc-pytest-plugin section) without :no-index: on either, triggering 9
"duplicate object description" warnings.
what:
- Replace _is_markdown_source with _is_native_myst (MockState isinstance
check); eval-rst-embedded directives now skip the {eval-rst} wrap
- Add no_index parameter to _render_autofixtures_nodes to emit :no-index:
on each generated autofixture directive when requested
- Add "no-index" flag option to AutofixturesDirective; pass it through to
_render_autofixtures_nodes
- Add :no-index: to the demo autofixtures:: spf_demo_fixtures eval-rst
block so doc-pytest-plugin remains the canonical fixture reference
- Document :no-index: option in the autofixtures options table1 parent 71ae109 commit db5e7b1
2 files changed
Lines changed: 33 additions & 17 deletions
File tree
- docs/packages
- packages/sphinx-autodoc-pytest-fixtures/src/sphinx_autodoc_pytest_fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
Lines changed: 31 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
111 | 131 | | |
112 | 132 | | |
113 | 133 | | |
114 | 134 | | |
115 | 135 | | |
116 | 136 | | |
| 137 | + | |
117 | 138 | | |
118 | 139 | | |
119 | 140 | | |
| |||
127 | 148 | | |
128 | 149 | | |
129 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
130 | 155 | | |
131 | 156 | | |
132 | 157 | | |
| |||
139 | 164 | | |
140 | 165 | | |
141 | 166 | | |
| 167 | + | |
| 168 | + | |
142 | 169 | | |
143 | 170 | | |
144 | 171 | | |
145 | | - | |
| 172 | + | |
146 | 173 | | |
147 | 174 | | |
148 | 175 | | |
| |||
151 | 178 | | |
152 | 179 | | |
153 | 180 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
| |||
590 | 602 | | |
591 | 603 | | |
592 | 604 | | |
| 605 | + | |
593 | 606 | | |
594 | 607 | | |
595 | 608 | | |
| |||
618 | 631 | | |
619 | 632 | | |
620 | 633 | | |
| 634 | + | |
621 | 635 | | |
622 | 636 | | |
623 | 637 | | |
| |||
0 commit comments