summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-04-03 16:08:10 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-04-03 16:08:10 (GMT)
commitd815d357b28a019faa515a56fd927b15cdb580cf (patch)
tree81ff8b38f5169fbe7be6e788fa89369300874c74 /Lib
parentc3a35e19cc1e3de5ae851600d3534fb98c999351 (diff)
downloadcpython-d815d357b28a019faa515a56fd927b15cdb580cf.zip
cpython-d815d357b28a019faa515a56fd927b15cdb580cf.tar.gz
cpython-d815d357b28a019faa515a56fd927b15cdb580cf.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_structmembers.py2
-rw-r--r--Lib/test/test_warnings.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_structmembers.py b/Lib/test/test_structmembers.py
index 93dd2ac..5dc2175 100644
--- a/Lib/test/test_structmembers.py
+++ b/Lib/test/test_structmembers.py
@@ -39,7 +39,7 @@ class ReadWriteTests(unittest.TestCase):
ts.T_ULONG=ULONG_MAX
self.assertEquals(ts.T_ULONG, ULONG_MAX)
-class TestWarnings(test.test_warnings.TestModule):
+class TestWarnings(test.test_warnings.CatchWarningTest):
def has_warned(self):
self.assertEqual(test.test_warnings.msg.category,
exceptions.RuntimeWarning.__name__)
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index a7ccb6b..0ad83ed 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -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