Actually run test_set_asyncio_event_loop().

This commit is contained in:
Andrey Rakhmatullin 2023-06-14 18:23:29 +04:00
parent d2e7f6e209
commit 7cfdca8f9b
1 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ from unittest import TestCase
from pytest import mark
from scrapy.utils.defer import deferred_f_from_coro_f
from scrapy.utils.reactor import (
install_reactor,
is_asyncio_reactor_installed,
@ -29,6 +30,8 @@ class AsyncioTest(TestCase):
assert original_reactor == reactor
@mark.only_asyncio()
@deferred_f_from_coro_f
async def test_set_asyncio_event_loop(self):
install_reactor("twisted.internet.asyncioreactor.AsyncioSelectorReactor")
assert set_asyncio_event_loop() is asyncio.get_running_loop()
assert set_asyncio_event_loop(None) is asyncio.get_running_loop()