summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tempfile.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-12-08 06:44:27 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-12-08 06:44:27 (GMT)
commit101d9e7250c039aeabea1582459d40b52cc81024 (patch)
treee0a6990c763c2435fae0a08a4114ac17569aa261 /Lib/test/test_tempfile.py
parent5ca129b8f016668bf914592e58082c452a7ad9b4 (diff)
parent7ef00ff91a0a90a2b11df40d110365e6a7909a94 (diff)
downloadcpython-101d9e7250c039aeabea1582459d40b52cc81024.zip
cpython-101d9e7250c039aeabea1582459d40b52cc81024.tar.gz
cpython-101d9e7250c039aeabea1582459d40b52cc81024.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 ac4d860..2e99013 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -324,10 +324,9 @@ class TestMkstempInner(BaseTestCase):
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)
@@ -339,10 +338,9 @@ class TestMkstempInner(BaseTestCase):
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"
@@ -378,10 +376,9 @@ class TestMkstempInner(BaseTestCase):
"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.
# A text file is truncated at the first Ctrl+Z byte
f = self.do_create(bin=0)
@@ -571,10 +568,9 @@ class TestMkdtemp(BaseTestCase):
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: