Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This class overrides some methods of AsyncCopy. It uses a task group to hold the worker and communicate is done through memory object streams. We also need an event to wait for the worker to complete. We add a _copycls attribute on AsyncConnection base class and AnyIOConnection so that the copy() context manager on cursor selects to proper Copy class (either AsyncCopy or AnyIOCopy). In copy tests, like in async connections ones, we alias the "aconn" fixture to "any_aconn", so as to run tests with both asyncio and trio backends. In test_context_active_rollback_no_clobber[trio], we need to properly close the rows() async generator in order to avoid a (trio) ResourceWarning. Tests test_copy_from_leaks and test_copy_to_leaks are only valid for asyncio backend because tenacity's AsyncRetrying is implemented using asyncio. We ignore an invalid error (raised by a deprecation warning during test) about usage of the 'loop' parameter in asyncio API that is due to Python bug as mentioned in comment.
- Loading branch information
Showing
5 changed files
with
99 additions
and
3 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