organize test-case-part explanation better

This commit is contained in:
protolambda 2019-07-30 03:09:48 +02:00
parent f5e404298b
commit bdebfe31df
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623

View File

@ -24,12 +24,18 @@ Options:
Test providers loading other configs will be ignored. If none are specified, no config will be ignored.
```
`gen_from_tests`: A util to derive tests from a tests source file.
## `gen_from_tests`
This is an util to derive tests from a tests source file.
This requires the tests to yield test-case-part outputs. These outputs are then written to the test case directory.
Yielding data is illegal in normal pytests, so it is only done when in "generator mode".
This functionality can be attached to any function by using the `vector_test()` decorator found in `ethspec/tests/utils.py`.
## Test-case parts
Test cases consist of parts, which are yielded to the base generator one by one.
The yielding pattern is:
2 value style: `yield <key name> <value>`. The kind of output will be inferred from the value by the `vector_test()` decorator.