[Python-checkins] r54673 - python/trunk/Lib/test/test_structmembers.py python/trunk/Lib/test/test_warnings.py

walter.doerwald python-checkins at python.org
Tue Apr 3 18:08:14 CEST 2007


Author: walter.doerwald
Date: Tue Apr 3 18:08:10 2007
New Revision: 54673
Modified:
 python/trunk/Lib/test/test_structmembers.py
 python/trunk/Lib/test/test_warnings.py
Log:
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.
Modified: python/trunk/Lib/test/test_structmembers.py
==============================================================================
--- python/trunk/Lib/test/test_structmembers.py	(original)
+++ python/trunk/Lib/test/test_structmembers.py	Tue Apr 3 18:08:10 2007
@@ -39,7 +39,7 @@
 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__)
Modified: python/trunk/Lib/test/test_warnings.py
==============================================================================
--- python/trunk/Lib/test/test_warnings.py	(original)
+++ python/trunk/Lib/test/test_warnings.py	Tue Apr 3 18:08:10 2007
@@ -20,7 +20,7 @@
 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 @@
 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /