template-fastapi-react icon indicating copy to clipboard operation
template-fastapi-react copied to clipboard

Evaluate PyHamcrest

Open eoaksnes opened this issue 3 years ago • 0 comments

Some background info for why we might consider evaluating PyHamcrest

When a test fails it’s very important to provide enough information on what went wrong. PyHamcrest can be used to create a custom matcher and include domain-specific debug information as tracing id, service version, etc. I mainly use it for creating custom response matcher. Incorporating custom response code matcher in your codebase is going to increase the readability of your tests and make it a little bit more maintainable — transition to another HTTP library would be easier, as you would need to change only custom matcher logic instead of changing the assertion of all your tests. But the biggest benefit lies in vastly improved debugging experience and thus reducing the time spent exploring failed tests and gathering information.

eoaksnes avatar Dec 22 '22 10:12 eoaksnes