Add docs on module level or global pytest fixture configuration
I wanted to override assert_all_called=True for my entire test suite, but couldn't quite see how from the docs. This PR adds info on how to override the respx_mock fixture at both the module level and globally.
How to globally enable respx is a great suggestion to the docs.
Normally I use an auto-used session scoped fixture for this, e.g. @pytest.fixture(scope="session", autouse=True). An autouse fixture may be simpler a more common test pattern (?).
Maybe the docs on custom fixtures would be a better place to include an example at .. possibly with a link from the guide.
Hmm yeah an autouse fixture is probably better for most uses.
In my case, I didn't want to affect httpx in tests that weren't otherwise mocking, so an autouse fixture (which would add mocking) wasn't ideal.
Well, mocking httpx for the test suite globally is preferred, preventing any external unwanted/accidental calls to be made .. at least IMO 😉 i.e. it's a good workflow when the test suite is able to run anywhere, without remote access.
BTW, the idea behind #227 is to allow the user to configure respx's default response/sideeffect e.g. NetworkError, to optionally simulating lack of network/remote access, and enforce the user to mock suitable responses for the endpoints called.