summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep277.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-11-15 21:27:43 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-11-15 21:27:43 (GMT)
commit8ab440e4771c4118e874cbb05b5f8f09a4408f49 (patch)
tree889e37790b5d834a14a3b58cfb8f4c3e6fbc88eb /Lib/test/test_pep277.py
parent8ad982cccf439419937bf2acf111f7ee197c4181 (diff)
parent1ab6c2d2c2b6c78e492491542007edfb880889f0 (diff)
downloadcpython-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.py9
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))