Test reports in MyST¶
The MyST forms of the specimens on Test reports: the directives, each rendered live by this page’s own Markdown parser. Their needs carry ids of their own, because a need id must be unique in the project.
A report, a suite and a case¶
A report, a suite and a case
```{test-file} Greeter report
:file: greeter.xml
:id: EX_TF_MYST_GREETER
The unit tests of the greeter.
```
```{test-suite} Greeter suite
:file: greeter.xml
:suite: greeter
:id: EX_TS_MYST_GREETER
:links: EX_TF_MYST_GREETER
```
```{test-case} Greeting
:file: greeter.xml
:suite: greeter
:case: test_greet
:id: EX_TC_MYST_GREET
:links: EX_TS_MYST_GREETER
Why this case matters.
```
The unit tests of the greeter. |
Why this case matters. |
A failing case¶
A failing case
```{test-case} Farewell
:file: greeter.xml
:suite: greeter
:case: test_farewell
:id: EX_TC_MYST_FAREWELL
The farewell wording is part of the greeter's contract.
```
The farewell wording is part of the greeter’s contract. Text:: assert farewell(“Ada”) == “Goodbye, Ada!” Message:: ‘Bye, Ada!’ != ‘Goodbye, Ada!’ |
A Sphinx build parses the evidence it appends to a MyST body as MyST, so its literal block does not render as one (The test-report directives).
A need per suite and per case¶
A need per suite and per case
```{test-file} Greeter report, expanded
:file: greeter.xml
:id: EX_TF_MYST_AUTO
:auto_suites:
:auto_cases:
```
Text:: assert farewell(“Ada”) == “Goodbye, Ada!” Message:: ‘Bye, Ada!’ != ‘Goodbye, Ada!’ |
Results tables¶
A results table
```{test-results} greeter.xml
```
greeter¶
Tests: 2, Failures: 1, Errors: 0, Skips: 0
Time: 0.02
class |
name |
status |
reason |
|---|---|---|---|
tests.test_greeter |
test_greet |
passed |
|
tests.test_greeter |
test_farewell |
failed |
‘Bye, Ada!’ != ‘Goodbye, Ada!’ assert farewell(“Ada”) == “Goodbye, Ada!” |
Environment tables¶
An environment table
```{test-env} greeter-env.json
:env: py313
:data: platform, python
```
py313¶
Variable |
Data |
|---|---|
platform |
linux |
python |
3.13.1 |