csernazs / pytest-httpserver

Http server for pytest to test http clients
MIT License
209 stars 27 forks source link

Add hooks functionality #295

Closed csernazs closed 1 month ago

csernazs commented 5 months ago

This will allow users to define one callable object (a hook) for each request handler, which will be called right before returning the response.

The hook has the possibility to return a new response object which will be used instead of the original one. The callback (hook) will receive the request and response objects.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.90%. Comparing base (6a5d6b8) to head (5720725). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #295 +/- ## ========================================== + Coverage 95.63% 95.90% +0.26% ========================================== Files 4 5 +1 Lines 619 659 +40 ========================================== + Hits 592 632 +40 Misses 27 27 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.