2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 18:19:42 +00:00

Update pytest how to for BIND system tests: add hypothesis command line switches

Petr Špaček 2025-07-10 12:36:23 +00:00
parent 6c368874a9
commit 35bedb22c8

@ -3,6 +3,7 @@ title: pytest how-to for BIND system tests
---
See [[/bin/tests/system/README|/../blob/main/bin/tests/system/README.md]] first
# Debugging
@ -16,3 +17,7 @@ Pytest has framework for providing 'context' to tests in a consistent manner. Th
# Runtime data
As a very first step, Pytest "collects" tests: Effectively it imports all Python files without executing test functions and does filtering (e.g. for `-k` command line parameter), and it executes `setup.sh` and other code only for tests which were selected/passed all conditions. For this reason you cannot access any files/data generated by `setup.sh` from _outside_ of test function body. This limitation applies also to arguments of @decorators around test functions.
# Hypothesis library
- `--hypothesis-show-statistics` to see how many examples the library generated and how many got actually executed
- `--hypothesis-seed=0` to get de-randomized behavior for debugging