mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Move the functionality for catching warnings in test_warnings.py into a separate
class to that reusing the functionality in test_structmembers.py doesn't rerun the tests from test_warnings.py.
This commit is contained in:
parent
c3a35e19cc
commit
d815d357b2
2 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,7 @@ def showwarning(message, category, filename, lineno, file=None):
|
|||
msg.filename = os.path.basename(filename)
|
||||
msg.lineno = lineno
|
||||
|
||||
class TestModule(unittest.TestCase):
|
||||
class CatchWarningTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
global msg
|
||||
|
@ -35,6 +35,8 @@ class TestModule(unittest.TestCase):
|
|||
warnings.filters = self._filters[:]
|
||||
warnings.showwarning = self._showwarning
|
||||
|
||||
class TestModule(CatchWarningTest):
|
||||
|
||||
def test_warn_default_category(self):
|
||||
for i in range(4):
|
||||
text = 'multi %d' %i # Different text on each call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue