File: doctest.md

package info (click to toggle)
python-sybil 9.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: python: 4,510; makefile: 90
file content (33 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# DocTest examples

A Python REPL / DocTest example using normal way of specifying Python
language:

```python
>>> 1+1
2
```

A Python REPL / DocTest example using a MyST role:

```{code-block} python
>>> 1 + 1
2
```

A Python REPL / DocTest example using the `{eval-rst}` role and the `.. doctest::` role
from `sphinx.ext.doctest`:


```{eval-rst}
.. doctest::

    >>> 1 + 1
    3
```


```{doctest}
>>> 1 + 1
4
```