Merged revisions 79539 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79539 | florent.xicluna | 2010-04-01 01:01:03 +0300 (Thu, 01 Apr 2010) | 2 lines
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
........
diff --git a/Lib/test/test_global.py b/Lib/test/test_global.py
index 22e4b25..abcb193 100644
--- a/Lib/test/test_global.py
+++ b/Lib/test/test_global.py
@@ -2,9 +2,8 @@
from test.test_support import run_unittest, check_syntax_error
import unittest
-
import warnings
-warnings.filterwarnings("error", module="<test string>")
+
class GlobalTests(unittest.TestCase):
@@ -45,7 +44,9 @@
def test_main():
- run_unittest(GlobalTests)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("error", module="<test string>")
+ run_unittest(GlobalTests)
if __name__ == "__main__":
test_main()