[Python-checkins] r63738 - python/trunk/Lib/test/test_py3kwarn.py

benjamin.peterson python-checkins at python.org
Tue May 27 03:42:29 CEST 2008


Author: benjamin.peterson
Date: Tue May 27 03:42:29 2008
New Revision: 63738

Log:
Improvements for test_py3kwarn
- Always show warnings so they are always catchable
- Make test_os_path_walk faster by walking a less populous directory


Modified:
   python/trunk/Lib/test/test_py3kwarn.py

Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py	(original)
+++ python/trunk/Lib/test/test_py3kwarn.py	Tue May 27 03:42:29 2008
@@ -207,9 +207,7 @@
         for path_mod in ("ntpath", "macpath", "os2emxpath", "posixpath"):
             mod = __import__(path_mod)
             with catch_warning() as w:
-                # Since os3exmpath just imports it from ntpath
-                warnings.simplefilter("always")
-                mod.walk(".", dumbo, None)
+                mod.walk("crashers", dumbo, None)
             self.assertEquals(str(w.message), msg)
 
     def test_commands_members(self):
@@ -223,8 +221,10 @@
 
 
 def test_main():
-    run_unittest(TestPy3KWarnings,
-                 TestStdlibRemovals)
+    with catch_warning(record=True):
+        warnings.simplefilter("always")
+        run_unittest(TestPy3KWarnings,
+                     TestStdlibRemovals)
 
 if __name__ == '__main__':
     test_main()


More information about the Python-checkins mailing list