Commit fa948422 authored by Victor Stinner's avatar Victor Stinner

Fix test_spwd on OpenIndiana

Issue #18787: restore "bin" name in test_spwd but catch KeyError.
parent 25b93cb9
......@@ -61,9 +61,14 @@ class TestSpwdRoot(unittest.TestCase):
class TestSpwdNonRoot(unittest.TestCase):
def test_getspnam_exception(self):
with self.assertRaises(PermissionError) as cm:
spwd.getspnam('root')
self.assertEqual(str(cm.exception), '[Errno 13] Permission denied')
name = 'bin'
try:
with self.assertRaises(PermissionError) as cm:
spwd.getspnam(name)
except KeyError as exc:
self.skipTest("spwd entry %r doesn't exist: %s" % (name, exc))
else:
self.assertEqual(str(cm.exception), '[Errno 13] Permission denied')
if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment