-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow mock https subrequest mocks. aiohttp_client compatibility
The `is_ssl` method was monkey-patched in a synchronous way that couldn't work when simultaneous requests needed it both patched and not-patched. Instead of undoing the ClientRequest monkey-patching we create DirectClientRequest and have our passthrough session use it instead. For compatibility between aresponses and aiohttp_client fixtures we use a work-around recommended by @serjshevchenko that replaces the aiohttp_client loop fixture with the event loop provided by pytest-asycnio. The hanging was caused by different fixtures running on different event loops.
- Loading branch information
1 parent
5bb3d1d
commit 6e5e346
Showing
4 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import math | ||
import re | ||
|
||
import pytest | ||
import aiohttp | ||
import pytest | ||
|
||
|
||
@pytest.mark.asyncio | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters