summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep277.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:13:25 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-06 11:13:25 (GMT)
commit2a23adf4405bcd903aabf445dd54867d95f494a1 (patch)
treefc4c823138cb505c180873976bc0a41ac3a1f6d5 /Lib/test/test_pep277.py
parentef920d6d5e38cebd51b17001d614b55b1c468041 (diff)
downloadcpython-2a23adf4405bcd903aabf445dd54867d95f494a1.zip
cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.tar.gz
cpython-2a23adf4405bcd903aabf445dd54867d95f494a1.tar.bz2
Use support.change_cwd() in tests.
Diffstat (limited to 'Lib/test/test_pep277.py')
-rw-r--r--Lib/test/test_pep277.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index 6c833a8..98c716b 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -158,17 +158,11 @@ class UnicodeFileTests(unittest.TestCase):
def test_directory(self):
dirname = os.path.join(support.TESTFN, 'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
filename = '\xdf-\u66e8\u66e9\u66eb'
- oldwd = os.getcwd()
- os.mkdir(dirname)
- os.chdir(dirname)
- try:
+ with support.temp_cwd(dirname):
with open(filename, 'wb') as f:
f.write((filename + '\n').encode("utf-8"))
os.access(filename,os.R_OK)
os.remove(filename)
- finally:
- os.chdir(oldwd)
- os.rmdir(dirname)
class UnicodeNFCFileTests(UnicodeFileTests):