From 622ce860669b8bd7fc581b74d414aef24f4fb041 Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta Date: Mon, 4 May 2020 16:22:24 -0300 Subject: [PATCH] Test: make sure scrapy.item.Item does not issue a deprecation warning --- tests/test_item.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_item.py b/tests/test_item.py index 1220bc98a..f35a2b9f9 100644 --- a/tests/test_item.py +++ b/tests/test_item.py @@ -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()