summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-17 12:53:32 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-17 12:53:32 (GMT)
commit84e7e5f40e2972af725e7f57e53bb6bcf3931912 (patch)
treedd91afbba71ebfe6d5193d7b46d20c95fa964e89 /Lib/test
parent6d562319d2ec43fb226861306b0d191aa1792489 (diff)
downloadcpython-84e7e5f40e2972af725e7f57e53bb6bcf3931912.zip
cpython-84e7e5f40e2972af725e7f57e53bb6bcf3931912.tar.gz
cpython-84e7e5f40e2972af725e7f57e53bb6bcf3931912.tar.bz2
Skip test for issue #17976 if /dev/null is not available.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_file2k.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py
index 5b90852..7e74e64 100644
--- a/Lib/test/test_file2k.py
+++ b/Lib/test/test_file2k.py
@@ -418,10 +418,16 @@ class OtherFileTests(unittest.TestCase):
@unittest.skipUnless(os.name == 'posix', 'test requires a posix system.')
def test_write_full(self):
# Issue #17976
- with open('/dev/full', 'w', 1) as f:
+ try:
+ f = open('/dev/full', 'w', 1)
+ except IOError:
+ self.skipTest("requires '/dev/full'")
+ try:
with self.assertRaises(IOError):
f.write('hello')
f.write('\n')
+ finally:
+ f.close()
class FileSubclassTests(unittest.TestCase):