Commit fcc05276 authored by Brett Cannon's avatar Brett Cannon

Merged revisions 70979 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70979 | brett.cannon | 2009-04-01 13:25:48 -0700 (Wed, 01 Apr 2009) | 3 lines

  test_warnings ironically had a single test that was not protecting the warnings
  filter and was resetting it.
........
parent b3af08f8
...@@ -470,14 +470,14 @@ class _WarningsTests(BaseTest): ...@@ -470,14 +470,14 @@ class _WarningsTests(BaseTest):
self.failUnless(text in result) self.failUnless(text in result)
def test_showwarning_not_callable(self): def test_showwarning_not_callable(self):
self.module.filterwarnings("always", category=UserWarning) with original_warnings.catch_warnings(module=self.module):
old_showwarning = self.module.showwarning self.module.filterwarnings("always", category=UserWarning)
self.module.showwarning = 23 old_showwarning = self.module.showwarning
try: self.module.showwarning = 23
self.assertRaises(TypeError, self.module.warn, "Warning!") try:
finally: self.assertRaises(TypeError, self.module.warn, "Warning!")
self.module.showwarning = old_showwarning finally:
self.module.resetwarnings() self.module.showwarning = old_showwarning
def test_show_warning_output(self): def test_show_warning_output(self):
# With showarning() missing, make sure that output is okay. # With showarning() missing, make sure that output is okay.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment