cpython: 96e543ba96a4 (original) (raw)
Mercurial > cpython
changeset 83954:96e543ba96a4
Issue #17746: Skip test_shutil.test_non_matching_mode when run as root or on unsuitable platform/environment. [#17746]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Tue, 28 May 2013 15:53:46 +0300 |
parents | 29a823f31465(current diff)b98380a1d979(diff) |
children | ad56dff3602f |
files | Lib/test/test_shutil.py |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-)[+] [-] Lib/test/test_shutil.py 4 |
line wrap: on
line diff
--- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -1338,9 +1338,13 @@ class TestWhich(unittest.TestCase): # Other platforms: shouldn't match in the current directory. self.assertIsNone(rv)
- @unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
def test_non_matching_mode(self): # Set the file read-only and ask for writeable files. os.chmod(self.temp_file.name, stat.S_IREAD)'non-root user required')[](#l1.8)
if os.access(self.temp_file.name, os.W_OK):[](#l1.12)
self.skipTest("can't set the file read-only")[](#l1.13) rv = shutil.which(self.file, path=self.dir, mode=os.W_OK)[](#l1.14) self.assertIsNone(rv)[](#l1.15)