pytest_httpx icon indicating copy to clipboard operation
pytest_httpx copied to clipboard

feat: control request assertion on callback level

Open felixscherz opened this issue 1 year ago • 1 comments

Hi, this PR introduces an assert_requested argument to control whether a callback should be checked for if it was called during test execution. This can already be controlled with the assert_all_responses_were_requested fixture on an all-or-nothing basis, but this feature allows more fine-grained control.

Let me know what you think!

felixscherz avatar May 14 '24 19:05 felixscherz

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarqubecloud[bot] avatar May 14 '24 19:05 sonarqubecloud[bot]

Hello @felixscherz

Thanks for the proposal. The next release will include a pytest marker allowing to configure assert_all_responses_were_requested per test case.

According to the test case you wrote, I assume this would fix your use case.

Feel free to open an issue describing your need if my assumption was wrong.

Thanks again

Colin-b avatar Sep 19 '24 21:09 Colin-b