1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-23 04:23:47 +00:00
scrapy/tests/test_utils_asyncio.py

18 lines
536 B
Python
Raw Normal View History

2019-08-22 18:15:02 +05:00
from unittest import TestCase
from pytest import mark
from scrapy.utils.asyncio import is_asyncio_reactor_installed, install_asyncio_reactor
2019-08-22 18:15:02 +05:00
@mark.usefixtures('reactor_pytest')
class AsyncioTest(TestCase):
def test_is_asyncio_reactor_installed(self):
2019-08-22 18:15:02 +05:00
# the result should depend only on the pytest --reactor argument
2019-12-26 20:46:54 +05:00
self.assertEqual(is_asyncio_reactor_installed(), self.reactor_pytest == 'asyncio')
2019-08-22 18:15:02 +05:00
def test_install_asyncio_reactor(self):
# this should do nothing
install_asyncio_reactor()