Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The AnyIOConnection class simply uses an anyio.Lock instead of an asyncio.Lock and relies on anyio waiting functions introduced earlier. There is no runtime dependency on anyio; this is left to the responsibility of the user. Thus, the AnyIOConnection class name is exported at package level only if available. When checking for windows compatibility in connect(), we now guard event loop lookup depending on the async library in use, since this is asyncio-specific. In tests, we add the following fixtures: * 'asyncconnection_class' (parametrized) which returns either AsyncConnection or AnyIOConnection class; * 'any_aconn' uses asyncconnection_class (thus also parametrized) and will thus build a connection of requested type. * 'asyncio_backend' useful to mark some tests only applicable for the asyncio backend (typically because they use asyncio in test code). Accordingly, async connections tests are now run with asyncio and trio backends as we alias 'aconn' fixture to 'any_aconn' in test_connection_async.py. The global 'pytestmark = pytest.mark.asyncio' is no longer needed as most test functions uses a fixture that depends on 'anyio_backend' which detects async functions. Only test_connect_(bad,)args() functions still need to be marked.
- Loading branch information
Showing
7 changed files
with
146 additions
and
40 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
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
Oops, something went wrong.