diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-15 21:27:43 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-15 21:27:43 (GMT) |
| commit | 8ab440e4771c4118e874cbb05b5f8f09a4408f49 (patch) | |
| tree | 889e37790b5d834a14a3b58cfb8f4c3e6fbc88eb /Lib/test/test_pep277.py | |
| parent | 8ad982cccf439419937bf2acf111f7ee197c4181 (diff) | |
| parent | 1ab6c2d2c2b6c78e492491542007edfb880889f0 (diff) | |
| download | cpython-8ab440e4771c4118e874cbb05b5f8f09a4408f49.zip cpython-8ab440e4771c4118e874cbb05b5f8f09a4408f49.tar.gz cpython-8ab440e4771c4118e874cbb05b5f8f09a4408f49.tar.bz2 | |
Merge
Diffstat (limited to 'Lib/test/test_pep277.py')
| -rw-r--r-- | Lib/test/test_pep277.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index a1a4791..4b16cbb 100644 --- a/Lib/test/test_pep277.py +++ b/Lib/test/test_pep277.py @@ -1,6 +1,9 @@ # Test the Unicode versions of normal file functions # open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir -import sys, os, unittest +import os +import sys +import unittest +import warnings from unicodedata import normalize from test import support @@ -155,7 +158,9 @@ class UnicodeFileTests(unittest.TestCase): @unittest.skipIf(sys.platform == 'darwin', 'irrelevant test on Mac OS X') def test_listdir(self): sf0 = set(self.files) - f1 = os.listdir(support.TESTFN.encode(sys.getfilesystemencoding())) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + f1 = os.listdir(support.TESTFN.encode(sys.getfilesystemencoding())) f2 = os.listdir(support.TESTFN) sf2 = set(os.path.join(support.TESTFN, f) for f in f2) self.assertEqual(sf0, sf2, "%a != %a" % (sf0, sf2)) |
