1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-25 20:44:18 +00:00

do not test multiple instantation warnings

This commit is contained in:
Daniel Graña 2014-01-16 09:49:51 -02:00
parent 31dd3dc4a1
commit 3e42646ce1

View File

@ -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)