File: test_scrapy__getattr__.py

package info (click to toggle)
python-scrapy 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,308 kB
  • sloc: python: 55,321; xml: 199; makefile: 25; sh: 7
file content (15 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import warnings


def test_deprecated_concurrent_requests_per_ip_attribute():
    with warnings.catch_warnings(record=True) as warns:
        from scrapy.settings.default_settings import (  # noqa: PLC0415
            CONCURRENT_REQUESTS_PER_IP,
        )

        assert CONCURRENT_REQUESTS_PER_IP is not None
        assert isinstance(CONCURRENT_REQUESTS_PER_IP, int)
        assert (
            "The scrapy.settings.default_settings.CONCURRENT_REQUESTS_PER_IP attribute is deprecated, use scrapy.settings.default_settings.CONCURRENT_REQUESTS_PER_DOMAIN instead."
            in warns[0].message.args
        )