mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-22 05:53:39 +00:00
23 lines
649 B
Python
23 lines
649 B
Python
"""
|
|
Selector tests for cssselect backend
|
|
"""
|
|
import warnings
|
|
from twisted.trial import unittest
|
|
from scrapy.selector.csstranslator import (
|
|
ScrapyHTMLTranslator,
|
|
ScrapyGenericTranslator,
|
|
ScrapyXPathExpr
|
|
)
|
|
|
|
|
|
class DeprecatedClassesTest(unittest.TestCase):
|
|
|
|
def test_deprecated_warnings(self):
|
|
for cls in [ScrapyHTMLTranslator, ScrapyGenericTranslator, ScrapyXPathExpr]:
|
|
with warnings.catch_warnings(record=True) as w:
|
|
obj = cls()
|
|
self.assertIn('%s is deprecated' % cls.__name__, str(w[-1].message),
|
|
'Missing deprecate warning for %s' % cls.__name__)
|
|
|
|
|