From 3e42646ce19edc54c82fd1a7caf38058452b51f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Thu, 16 Jan 2014 09:49:51 -0200 Subject: [PATCH] do not test multiple instantation warnings --- scrapy/tests/test_utils_deprecate.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scrapy/tests/test_utils_deprecate.py b/scrapy/tests/test_utils_deprecate.py index 75a53b2bf..07b9a3dd5 100644 --- a/scrapy/tests/test_utils_deprecate.py +++ b/scrapy/tests/test_utils_deprecate.py @@ -109,10 +109,8 @@ class WarnWhenSubclassedTest(unittest.TestCase): pass with warnings.catch_warnings(record=True) as w: - # warns only once on instantations in the same lineno - for _ in range(10): - _, lineno = Deprecated(), inspect.getlineno(inspect.currentframe()) - _ = UserClass() # subclass instances don't warn + _, lineno = Deprecated(), inspect.getlineno(inspect.currentframe()) + _ = UserClass() # subclass instances don't warn w = self._mywarnings(w) self.assertEqual(len(w), 1)