-
Notifications
You must be signed in to change notification settings - Fork 11
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
Migrate asynctest to stdlib's AsyncMock #9
Comments
Thank you for reporting @eclipseo! 😊 I've tried reproducing the errors described in the issues you linked, yet to no avail - all tests succeed on Python 3.8.5, Databay 0.1.5. I can carry out the migration to AsyncMock right away, but I'd first like to know that I'm fixing whatever issues happen using asynctest on Python 3.8. I'm assuming you tried running the tests and they failed for you? It would be great to know which tests failed and in what way. Could you please provide more details? Use the following template if you may: Describe the bug To Reproduce
Expected behavior Environment Additional context Suggest a Fix Thank you! |
On a Fedora system (local build for the RPM package): [...]
platform linux -- Python 3.8.5, pytest-4.6.11, py-1.8.2, pluggy-0.13.1 -- /usr/bin/python3
[...]
test/test/unit/outlets/test_print_outlet.py::TestPrintOutlet::test_push PASSED [ 98%]
test/test/unit/outlets/test_print_outlet.py::TestPrintOutlet::test_push_only_payload PASSED [ 99%]
test/test/unit/outlets/test_print_outlet.py::TestPrintOutlet::test_push_skip_update PASSED [100%]
============================================================================================================= FAILURES =============================================================================================================
______________________________________________________________________________________________ TestConfig.test_event_loop_policy_3_7 _______________________________________________________________________________________________
self = <test.unit.test_config.TestConfig testMethod=test_event_loop_policy_3_7>, version_info = <MagicMock name='version_info' id='140633192203696'>
@patch('sys.platform', 'win32')
@patch('sys.version_info')
def test_event_loop_policy_3_7(self, version_info):
version_info.__getitem__.side_effect = lambda x: [3, 7][x]
# fake a manual 3.8 default setup
> asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
E AttributeError: module 'asyncio' has no attribute 'WindowsProactorEventLoopPolicy'
test/test/unit/test_config.py:36: AttributeError
______________________________________________________________________________________________ TestConfig.test_event_loop_policy_3_8 _______________________________________________________________________________________________
self = <test.unit.test_config.TestConfig testMethod=test_event_loop_policy_3_8>, version_info = <MagicMock name='version_info' id='140633192146640'>
@patch('sys.platform', 'win32')
@patch('sys.version_info')
def test_event_loop_policy_3_8(self, version_info):
version_info.__getitem__.side_effect = lambda x: [3, 8][x]
# fake a 3.8 default setup
> asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
E AttributeError: module 'asyncio' has no attribute 'WindowsProactorEventLoopPolicy'
test/test/unit/test_config.py:24: AttributeError
========================================================================================================= warnings summary =========================================================================================================
/usr/lib/python3.8/site-packages/asynctest/mock.py:434
/usr/lib/python3.8/site-packages/asynctest/mock.py:434: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
def wait(self, skip=0):
/usr/lib/python3.8/site-packages/asynctest/mock.py:448 |
Thanks @fabaff for this report. This one in particular seems to be unrelated from the asynctest issue and is an issue of its own, as instead it is caused by running windows-specific test on a non-windows platform. If you had any error logs from the asynctest tests under Python 3.8 we'd appreciate these too. |
We just released version 0.2.0 that should address this issue. Please reopen if the problems persist. Thanks for submitting it 👋 |
Asynctest doesn't work with python 3.8 and above.
Asynctest upstream is aware of this breakage and recommends using the built-in AsyncMock instead. See also Martiusweb/asynctest#144 and Martiusweb/asynctest#126 .
The text was updated successfully, but these errors were encountered: