Test: make sure scrapy.item.Item does not issue a deprecation warning

This commit is contained in:
Eugenio Lacuesta 2020-05-04 16:22:24 -03:00
parent f75941f79d
commit 622ce86066
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
1 changed files with 13 additions and 0 deletions

View File

@ -347,5 +347,18 @@ class BaseItemTest(unittest.TestCase):
self.assertEqual(warnings[0].category, ScrapyDeprecationWarning)
class ItemNoDeprecationWarningTest(unittest.TestCase):
def test_no_deprecation_warning(self):
with catch_warnings(record=True) as warnings:
Item()
self.assertEqual(len(warnings), 0)
with catch_warnings(record=True) as warnings:
class SubclassedItem(Item):
pass
SubclassedItem()
self.assertEqual(len(warnings), 0)
if __name__ == "__main__":
unittest.main()