diff options
Diffstat (limited to 'Lib/test/test_tempfile.py')
| -rw-r--r-- | Lib/test/test_tempfile.py | 12 |
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: |
