summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tempfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-09 20:27:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-09 20:27:23 (GMT)
commit26cab565423a830701667555980232baeca07580 (patch)
tree2bbccd21ea340ea78158efefe4eae980d0f963a0 /Lib/test/test_tempfile.py
parent31c3cd2fb8aa7d587f1c1317052f48f45de97094 (diff)
parent7451a72e2ba8939215324387e36285725632e637 (diff)
downloadcpython-26cab565423a830701667555980232baeca07580.zip
cpython-26cab565423a830701667555980232baeca07580.tar.gz
cpython-26cab565423a830701667555980232baeca07580.tar.bz2
Issue #17169: Restore errno in tempfile exceptions.
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r--Lib/test/test_tempfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index b0c3b4b..ecad944 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -1,5 +1,6 @@
# tempfile.py unit tests.
import tempfile
+import errno
import os
import signal
import sys
@@ -963,8 +964,9 @@ class TestTemporaryDirectory(BaseTestCase):
# (noted as part of Issue #10188)
with tempfile.TemporaryDirectory() as nonexistent:
pass
- with self.assertRaises(OSError):
+ with self.assertRaises(FileNotFoundError) as cm:
tempfile.TemporaryDirectory(dir=nonexistent)
+ self.assertEqual(cm.exception.errno, errno.ENOENT)
def test_explicit_cleanup(self):
# A TemporaryDirectory is deleted when cleaned up