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:
parent
31dd3dc4a1
commit
3e42646ce1
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user