I am using a plugin tavern_fastapi and that requires me to repeat this snippet across test files:
fastapi:
app:
location: "tests.fastapi_test_app"
Now I know how to include common variables like so:
includes:
- !include common_variables.yaml
but if I wanted to include the first snippet across tests, is there a way to do so?
A complete test_a.tavern.yaml look like:
---
test_name: output comparison tests
includes:
- !include common.yaml
# TODO: Move this into a common.root.yaml
fastapi:
app:
location: "tests.fastapi_test_app"
# TODO: Move this into a common.root.yaml
strict:
- headers:off
- json:off
marks:
- usefixtures:
- compare_service
stages:
- name: Compute resource
request:
url: "{endpoint}/{name}"
method: GET
headers:
content-type: application/json
response:
status_code: 200
verify_response_with:
function: tests.fastapitavern.utils:compare
I am using a plugin
tavern_fastapiand that requires me to repeat this snippet across test files:Now I know how to include common variables like so:
but if I wanted to include the first snippet across tests, is there a way to do so?
A complete
test_a.tavern.yamllook like: