1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-23 10:04:07 +00:00
scrapy/tests/test_pydispatch_deprecated.py

13 lines
436 B
Python

import unittest
import warnings
from six.moves import reload_module
class DeprecatedPydispatchTest(unittest.TestCase):
def test_import_xlib_pydispatch_show_warning(self):
with warnings.catch_warnings(record=True) as w:
from scrapy.xlib import pydispatch
reload_module(pydispatch)
self.assertIn('Importing from scrapy.xlib.pydispatch is deprecated',
str(w[0].message))