Closed WinstonLoser closed 2 months ago
If you want to use parametrize with a integer then it will implicitly be converted into a string, if you don't want that you need to explicitly convert it to an integer using a type token (https://tavern.readthedocs.io/en/latest/basics.html#type-conversions) like
response:
status_code: 200
json:
id: !int "{id}"
userId: !int "{userId}"
Using parametrize with status codes isn't supported, but you can have a list of expected status codes like: https://github.com/taverntesting/tavern/blob/4396844435a74d0af4c06ca64eb1c15cf02b61ab/tests/integration/test_status_codes.tavern.yaml#L24-L26 If you want to check that an endpoint gives a different status code for different inputs then its best to just split it into 2 separate tests.
I tried the basic test,
test_minimal.tavern.yaml
that mentioned in README with parameterize and notice that the values in parametrize are changed into string type which cause AssertionError:So does it only support for string type key? And I find that status_code is not supported parametrize, does it?