summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tempfile.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-12-10 20:09:20 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-12-10 20:09:20 (GMT)
commit1f70221b861a3714735251d57695b2f472d0599b (patch)
tree945cd43b04b6351e71c23aa0cb19f6fab1f3ddda /Lib/test/test_tempfile.py
parent284164b47638e4e71a933ce136a33fdd352f7bac (diff)
downloadcpython-1f70221b861a3714735251d57695b2f472d0599b.zip
cpython-1f70221b861a3714735251d57695b2f472d0599b.tar.gz
cpython-1f70221b861a3714735251d57695b2f472d0599b.tar.bz2
Issue #19572: More silently skipped tests explicitly skipped.
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r--Lib/test/test_tempfile.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 011e7d0..40f70c0 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -342,10 +342,9 @@ class test__mkstemp_inner(TC):
finally:
os.rmdir(dir)
+ @unittest.skipUnless(has_stat, 'os.stat not available')
def test_file_mode(self):
# _mkstemp_inner creates files with the proper mode
- if not has_stat:
- return # ugh, can't use SkipTest.
file = self.do_create()
mode = stat.S_IMODE(os.stat(file.name).st_mode)
@@ -357,10 +356,9 @@ class test__mkstemp_inner(TC):
expected = user * (1 + 8 + 64)
self.assertEqual(mode, expected)
+ @unittest.skipUnless(has_spawnl, 'os.spawnl not available')
def test_noinherit(self):
# _mkstemp_inner file handles are not inherited by child processes
- if not has_spawnl:
- return # ugh, can't use SkipTest.
if support.verbose:
v="v"
@@ -395,10 +393,9 @@ class test__mkstemp_inner(TC):
"child process caught fatal signal %d" % -retval)
self.assertFalse(retval > 0, "child process reports failure %d"%retval)
+ @unittest.skipUnless(has_textmode, "text mode not available")
def test_textmode(self):
# _mkstemp_inner can create files in text mode
- if not has_textmode:
- return # ugh, can't use SkipTest.
self.do_create(bin=0).write("blat\n")
# XXX should test that the file really is a text file
@@ -590,10 +587,9 @@ class test_mkdtemp(TC):
finally:
os.rmdir(dir)
+ @unittest.skipUnless(has_stat, 'os.stat not available')
def test_mode(self):
# mkdtemp creates directories with the proper mode
- if not has_stat:
- return # ugh, can't use SkipTest.
dir = self.do_create()
try: