Issue #23738: Document and test actual keyword parameter names

Also fix signature because os.utime(..., ns=None) is not allowed.
This commit is contained in:
Martin Panter 2015-09-09 01:01:13 +00:00
parent 5558d4f2f8
commit bf19d16950
9 changed files with 73 additions and 31 deletions

View file

@ -443,6 +443,14 @@ class PosixTester(unittest.TestCase):
else:
self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode))
# Keyword arguments are also supported
support.unlink(support.TESTFN)
try:
posix.mknod(path=support.TESTFN, mode=mode, device=0,
dir_fd=None)
except OSError as e:
self.assertIn(e.errno, (errno.EPERM, errno.EINVAL))
@unittest.skipUnless(hasattr(posix, 'stat'), 'test needs posix.stat()')
@unittest.skipUnless(hasattr(posix, 'makedev'), 'test needs posix.makedev()')
def test_makedev(self):