Code inside an included ``only`` block should execute normally. When building with the html builder, an ``only:: html`` directive should allow the ipython directive to execute code as usual.
()
| 85 | |
| 86 | |
| 87 | def test_only_included_executes_normally(): |
| 88 | """Code inside an included ``only`` block should execute normally. |
| 89 | |
| 90 | When building with the html builder, an ``only:: html`` directive |
| 91 | should allow the ipython directive to execute code as usual. |
| 92 | """ |
| 93 | n = _build_sphinx( |
| 94 | """ |
| 95 | Test |
| 96 | ==== |
| 97 | |
| 98 | .. only:: html |
| 99 | |
| 100 | .. ipython:: |
| 101 | |
| 102 | In [1]: x = 1 |
| 103 | |
| 104 | .. ipython:: |
| 105 | |
| 106 | In [1]: y = 2 |
| 107 | """, |
| 108 | builder="html", |
| 109 | tags=["html"], |
| 110 | ) |
| 111 | # Both directives should execute. |
| 112 | assert n == 2 |
| 113 | |
| 114 | |
| 115 | def test_nested_only_skips_execution(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…