Nested ``only`` with a false condition should skip execution. When ``only:: html`` is true but the inner ``only:: latex`` is false, the ipython directive inside the inner block should skip.
()
| 113 | |
| 114 | |
| 115 | def test_nested_only_skips_execution(): |
| 116 | """Nested ``only`` with a false condition should skip execution. |
| 117 | |
| 118 | When ``only:: html`` is true but the inner ``only:: latex`` is |
| 119 | false, the ipython directive inside the inner block should skip. |
| 120 | """ |
| 121 | n = _build_sphinx( |
| 122 | """ |
| 123 | Test |
| 124 | ==== |
| 125 | |
| 126 | .. only:: html |
| 127 | |
| 128 | .. only:: latex |
| 129 | |
| 130 | .. ipython:: |
| 131 | |
| 132 | In [1]: x = 1 |
| 133 | """, |
| 134 | builder="html", |
| 135 | tags=["html"], |
| 136 | ) |
| 137 | # The inner only:: latex is excluded, so no execution. |
| 138 | assert n == 0 |
nothing calls this directly
no test coverage detected
searching dependent graphs…