mirror of https://github.com/python/cpython
gh-102519: Avoid failing tests due to inaccessible volumes (GH-102706)
This commit is contained in:
parent
0a539b5db3
commit
5fce813d8e
|
@ -2683,12 +2683,17 @@ class Win32ListdriveTests(unittest.TestCase):
|
|||
|
||||
def test_listmounts(self):
|
||||
for volume in os.listvolumes():
|
||||
mounts = os.listmounts(volume)
|
||||
self.assertIsInstance(mounts, list)
|
||||
self.assertSetEqual(
|
||||
set(mounts),
|
||||
self.known_mounts & set(mounts),
|
||||
)
|
||||
try:
|
||||
mounts = os.listmounts(volume)
|
||||
except OSError as ex:
|
||||
if support.verbose:
|
||||
print("Skipping", volume, "because of", ex)
|
||||
else:
|
||||
self.assertIsInstance(mounts, list)
|
||||
self.assertSetEqual(
|
||||
set(mounts),
|
||||
self.known_mounts & set(mounts),
|
||||
)
|
||||
|
||||
|
||||
@unittest.skipUnless(hasattr(os, 'readlink'), 'needs os.readlink()')
|
||||
|
|
Loading…
Reference in New Issue