mirror of https://github.com/scrapy/scrapy.git
Assorted test fixes (#7585)
* Fix the mitmproxy junitxml file name. * Fix TestAsyncCrawlerRunnerHasSpider regression. * Update split out file refs. * Update the test_counter_handler() docstring.
This commit is contained in:
parent
4e956bd2de
commit
ddafb37a7c
|
|
@ -24,13 +24,13 @@ def _py_files(folder):
|
|||
collect_ignore = [
|
||||
# may need extra deps
|
||||
"docs/_ext",
|
||||
# contains scripts to be run by tests/test_crawler.py::AsyncCrawlerProcessSubprocess
|
||||
# contains scripts to be run by tests/test_crawler_subprocess.py::AsyncCrawlerProcessSubprocess
|
||||
*_py_files("tests/AsyncCrawlerProcess"),
|
||||
# contains scripts to be run by tests/test_crawler.py::AsyncCrawlerRunnerSubprocess
|
||||
# contains scripts to be run by tests/test_crawler_subprocess.py::AsyncCrawlerRunnerSubprocess
|
||||
*_py_files("tests/AsyncCrawlerRunner"),
|
||||
# contains scripts to be run by tests/test_crawler.py::CrawlerProcessSubprocess
|
||||
# contains scripts to be run by tests/test_crawler_subprocess.py::CrawlerProcessSubprocess
|
||||
*_py_files("tests/CrawlerProcess"),
|
||||
# contains scripts to be run by tests/test_crawler.py::CrawlerRunnerSubprocess
|
||||
# contains scripts to be run by tests/test_crawler_subprocess.py::CrawlerRunnerSubprocess
|
||||
*_py_files("tests/CrawlerRunner"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -764,8 +764,8 @@ class TestCrawlerRunnerHasSpider:
|
|||
|
||||
@pytest.mark.only_asyncio
|
||||
class TestAsyncCrawlerRunnerHasSpider(TestCrawlerRunnerHasSpider):
|
||||
@staticmethod
|
||||
def _runner() -> CrawlerRunnerBase:
|
||||
@pytest.fixture
|
||||
def runner(self) -> CrawlerRunnerBase:
|
||||
return AsyncCrawlerRunner(get_reactor_settings())
|
||||
|
||||
def test_crawler_runner_asyncio_enabled_true(self) -> None: # type: ignore[override]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ from tests.utils.decorators import coroutine_test
|
|||
def test_counter_handler() -> None:
|
||||
"""Test that ``LogCounterHandler`` is always properly removed.
|
||||
|
||||
It's added in ``Crawler.crawl{,_async}()`` and removed on engine_stopped.
|
||||
It's added in ``LogCount.spider_opened()`` and removed in
|
||||
``LogCount.spider_closed()``.
|
||||
"""
|
||||
c = sum(1 for h in logging.root.handlers if isinstance(h, LogCounterHandler))
|
||||
assert c == 0
|
||||
|
|
|
|||
2
tox.ini
2
tox.ini
|
|
@ -307,4 +307,4 @@ deps =
|
|||
mitmproxy; implementation_name != "pypy"
|
||||
httpx[http2,socks]
|
||||
commands =
|
||||
pytest {posargs:--cov-config=pyproject.toml --cov=scrapy --cov-report=xml --cov-report= tests --junitxml=botocore.junit.xml -o junit_family=legacy} -m requires_mitmproxy
|
||||
pytest {posargs:--cov-config=pyproject.toml --cov=scrapy --cov-report=xml --cov-report= tests --junitxml=mitmproxy.junit.xml -o junit_family=legacy} -m requires_mitmproxy
|
||||
|
|
|
|||
Loading…
Reference in New Issue