Skip to content

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

Run tests using the asyncio reactor.

Andrey Rakhmatullin977763953337
diff --git a/pytest.ini b/pytest.ini
index 33c34b8e8..6c4c21baf 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -5,6 +5,7 @@ python_classes=
addopts =
--assert=plain
--doctest-modules
+ --reactor=asyncio
--ignore=docs/_ext
--ignore=docs/conf.py
--ignore=docs/news.rst
diff --git a/tests/mockserver.py b/tests/mockserver.py
index 7ebb8bb62..b6aee009a 100644
--- a/tests/mockserver.py
+++ b/tests/mockserver.py
@@ -6,6 +6,9 @@ from subprocess import Popen, PIPE
from OpenSSL import SSL
from six.moves.urllib.parse import urlencode
+
+import scrapy # needed before importing twisted.internet.reactor
+
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.web.static import File
diff --git a/tests/requirements-py3.txt b/tests/requirements-py3.txt
index c4bc1f278..26ab08b04 100644
--- a/tests/requirements-py3.txt
+++ b/tests/requirements-py3.txt
@@ -4,7 +4,8 @@ mitmproxy; python_version >= '3.6'
mitmproxy==3.0.4; python_version < '3.6'
pytest
pytest-cov
-pytest-twisted
+#pytest-twisted
+-e git+https://github.com/pytest-dev/pytest-twisted@81b91f17#egg=pytest-twisted
pytest-xdist
sybil
testfixtures