Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

➖ remove asynctest dependency and replace with unittest #449

Merged
merged 8 commits into from
May 16, 2024

Conversation

ff137
Copy link
Contributor

@ff137 ff137 commented May 9, 2024

Replaces asynctest with unittest in all modules

Includes formatting changes from #448. Marking as draft until that one's merged

@ff137
Copy link
Contributor Author

ff137 commented May 9, 2024

For some reason the relay image in redis-events was bumped to pydantic 2, causing the prev test failures. Resolved this by pinning pydantic <2 in redis-events/docker/services/

@ff137 ff137 marked this pull request as ready for review May 14, 2024 17:35
@ff137
Copy link
Contributor Author

ff137 commented May 14, 2024

This one's probably harder to review, but it's all in the 3f7a901 commit!

To help summarise: all of the asynctest imports can essentially be swapped to unittest.
So we had from asynctest import mock as async_mock, and then everywhere that async_mock.MagicMock is used, that can be swapped for unittest.MagicMock. Same with patch, AsyncMock, etc.

Lastly, AsyncTestCase is now IsolatedAsyncioTestCase, and the setUp method had to be renamed to asyncSetUp.
That's it! Works like a charm.

Main motivation is not wanting deprecated dependencies, but also to get the testing framework in sync with ACA-Py (as in openwallet-foundation/acapy#2566 and openwallet-foundation/acapy#2755), helps with maintainability across the repos

@ff137 ff137 force-pushed the drop-asynctest branch from 9126985 to 1dcc50a Compare May 15, 2024 20:05
@jamshale jamshale requested review from jamshale, amanji and dbluhm May 15, 2024 20:22
@ff137 ff137 changed the title ➖ remove asynctest dependency ➖ remove asynctest dependency and replace with unittest May 16, 2024
@jamshale jamshale merged commit 970a82c into openwallet-foundation:main May 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants