mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-102519: Avoid failing tests due to inaccessible volumes (GH-102706)
This commit is contained in:
parent
0a539b5db3
commit
5fce813d8e
1 changed files with 11 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue