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
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
|
||||
@ -15,4 +16,8 @@ See [[/bin/tests/system/README|/../blob/main/bin/tests/system/README.md]] first
|
||||
Pytest has framework for providing 'context' to tests in a consistent manner. Their term for it is 'fixture' and it manifests itself as a function parameter with name which is nowhere to be found. See https://docs.pytest.org/en/7.1.x/explanation/fixtures.html
|
||||
|
||||
# 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.
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user