1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-06 16:31:38 +00:00
scrapy/tests/test_scrapy__getattr__.py
Laerte Pereira d2bdbad8c8
Deprecate scrapy.twisted_version (#6512)
* Deprecate scrapy.twisted_version

* fix: typing

* remove typing

* raise default exception if attribute is not found

* remove redudant ()

* add tests

* rollback exception raised

* add filterwarnings again

* change order

* lint
2024-10-30 00:28:35 +05:00

14 lines
408 B
Python

import warnings
def test_deprecated_twisted_version():
with warnings.catch_warnings(record=True) as warns:
from scrapy import twisted_version
assert twisted_version is not None
assert isinstance(twisted_version, tuple)
assert (
"The scrapy.twisted_version attribute is deprecated, use twisted.version instead"
in warns[0].message.args
)