Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Actually run test_set_asyncio_event_loop().

Andrey Rakhmatullin7cfdca8f9b1b
diff --git a/tests/test_utils_asyncio.py b/tests/test_utils_asyncio.py
index 01d0ee043..65e352053 100644
--- a/tests/test_utils_asyncio.py
+++ b/tests/test_utils_asyncio.py
@@ -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()