Message 220565 - Python tracker (original) (raw)
Looks good to me. But aren't the last two lines skipped if an error is raised by the first line from the with block?
with self.assertRaises(FileNotFoundError):
shutil.chown('invalid-file', user=uid, dir_fd=dirfd)
shutil.chown('invalid-file', group=gid, dir_fd=dirfd)
shutil.chown('invalid-file', user=uid, group=gid, dir_fd=dirfd)