summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-05-27 01:42:29 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-05-27 01:42:29 (GMT)
commit1d31023b314228a729a480c325bbd5972be69fa0 (patch)
treee9f39b91e0e0e49dea4c4a715a0c804a00995f5f
parent838c7b3619cc8c68d115235c4bf3b0ab19eb5d04 (diff)
downloadcpython-1d31023b314228a729a480c325bbd5972be69fa0.zip
cpython-1d31023b314228a729a480c325bbd5972be69fa0.tar.gz
cpython-1d31023b314228a729a480c325bbd5972be69fa0.tar.bz2
Improvements for test_py3kwarn
- Always show warnings so they are always catchable - Make test_os_path_walk faster by walking a less populous directory
-rw-r--r--Lib/test/test_py3kwarn.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index d5574f4..d023e4b 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -207,9 +207,7 @@ class TestStdlibRemovals(unittest.TestCase):
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 @@ class TestStdlibRemovals(unittest.TestCase):
def test_main():
- run_unittest(TestPy3KWarnings,
- TestStdlibRemovals)
+ with catch_warning(record=True):
+ warnings.simplefilter("always")
+ run_unittest(TestPy3KWarnings,
+ TestStdlibRemovals)
if __name__ == '__main__':
test_main()