Skip to content

Commit

Permalink
Update documentation expectations for Parsel 1.8.0 (scrapy#5902)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxlil authored Apr 21, 2023
1 parent 87c8c51 commit 5a37af1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/intro/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ object:
.. code-block:: pycon
>>> response.css("title")
[<Selector xpath='descendant-or-self::title' data='<title>Quotes to Scrape</title>'>]
[<Selector query='descendant-or-self::title' data='<title>Quotes to Scrape</title>'>]
The result of running ``response.css('title')`` is a list-like object called
:class:`~scrapy.selector.SelectorList`, which represents a list of
Expand Down Expand Up @@ -348,7 +348,7 @@ Besides `CSS`_, Scrapy selectors also support using `XPath`_ expressions:
.. code-block:: pycon
>>> response.xpath("//title")
[<Selector xpath='//title' data='<title>Quotes to Scrape</title>'>]
[<Selector query='//title' data='<title>Quotes to Scrape</title>'>]
>>> response.xpath("//title/text()").get()
'Quotes to Scrape'
Expand Down Expand Up @@ -410,8 +410,8 @@ We get a list of selectors for the quote HTML elements with:
.. code-block:: pycon
>>> response.css("div.quote")
[<Selector xpath="descendant-or-self::div[@class and contains(concat(' ', normalize-space(@class), ' '), ' quote ')]" data='<div class="quote" itemscope itemtype...'>,
<Selector xpath="descendant-or-self::div[@class and contains(concat(' ', normalize-space(@class), ' '), ' quote ')]" data='<div class="quote" itemscope itemtype...'>,
[<Selector query="descendant-or-self::div[@class and contains(concat(' ', normalize-space(@class), ' '), ' quote ')]" data='<div class="quote" itemscope itemtype...'>,
<Selector query="descendant-or-self::div[@class and contains(concat(' ', normalize-space(@class), ' '), ' quote ')]" data='<div class="quote" itemscope itemtype...'>,
...]
Each of the selectors returned by the query above allows us to run further
Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ python_files=test_*.py __init__.py
python_classes=
addopts =
--assert=plain
--doctest-modules
--ignore=docs/_ext
--ignore=docs/conf.py
--ignore=docs/news.rst
Expand Down
11 changes: 8 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ passenv =
#allow tox virtualenv to upgrade pip/wheel/setuptools
download = true
commands =
pytest --cov=scrapy --cov-report=xml --cov-report= {posargs:--durations=10 docs scrapy tests}
pytest --cov=scrapy --cov-report=xml --cov-report= {posargs:--durations=10 docs scrapy tests} --doctest-modules
install_command =
python -I -m pip install -ctests/upper-constraints.txt {opts} {packages}

Expand Down Expand Up @@ -99,6 +99,8 @@ setenv =
_SCRAPY_PINNED=true
install_command =
python -I -m pip install {opts} {packages}
commands =
pytest --cov=scrapy --cov-report=xml --cov-report= {posargs:--durations=10 scrapy tests}

[testenv:pinned]
basepython = python3.7
Expand All @@ -108,6 +110,7 @@ deps =
install_command = {[pinned]install_command}
setenv =
{[pinned]setenv}
commands = {[pinned]commands}

[testenv:windows-pinned]
basepython = python3
Expand All @@ -117,6 +120,7 @@ deps =
install_command = {[pinned]install_command}
setenv =
{[pinned]setenv}
commands = {[pinned]commands}

[testenv:extra-deps]
basepython = python3
Expand All @@ -137,7 +141,7 @@ commands =

[testenv:asyncio-pinned]
deps = {[testenv:pinned]deps}
commands = {[testenv:asyncio]commands}
commands = {[pinned]commands} --reactor=asyncio
install_command = {[pinned]install_command}
setenv =
{[pinned]setenv}
Expand All @@ -152,7 +156,8 @@ basepython = {[testenv:pypy3]basepython}
deps =
{[pinned]deps}
PyPyDispatcher==2.1.0
commands = {[testenv:pypy3]commands}
commands =
pytest --durations=10 scrapy tests
install_command = {[pinned]install_command}
setenv =
{[pinned]setenv}
Expand Down

0 comments on commit 5a37af1

Please sign in to comment.