diff options
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index eecddfed8c..395f065234 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -75,8 +75,9 @@ class PosixTester(unittest.TestCase): for name in NO_ARG_FUNCTIONS: posix_func = getattr(posix, name, None) if posix_func is not None: - posix_func() - self.assertRaises(TypeError, posix_func, 1) + with self.subTest(name): + posix_func() + self.assertRaises(TypeError, posix_func, 1) @unittest.skipUnless(hasattr(posix, 'getresuid'), 'test needs posix.getresuid()') @@ -1399,7 +1400,10 @@ class TestPosixDirFd(unittest.TestCase): # whoops! using both together not supported on this platform. pass - @unittest.skipUnless(os.link in os.supports_dir_fd, "test needs dir_fd support in os.link()") + @unittest.skipUnless( + hasattr(os, "link") and os.link in os.supports_dir_fd, + "test needs dir_fd support in os.link()" + ) def test_link_dir_fd(self): with self.prepare_file() as (dir_fd, name, fullname), \ self.prepare() as (dir_fd2, linkname, fulllinkname): |