From b37b4010a5f3569e8379360662a925ba04a886bf Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 22 Feb 2018 16:13:10 +0100 Subject: tests: Assert for /proc being a mountpoint for cross-fs tests Skip cross-fs tests if /proc is not a mountpoint. This handles cases when /proc exists but is not mounted which is quite normal e.g. on Gentoo/FreeBSD. --- tests/test_find_top_level.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_find_top_level.py') diff --git a/tests/test_find_top_level.py b/tests/test_find_top_level.py index a326384..17f83c4 100644 --- a/tests/test_find_top_level.py +++ b/tests/test_find_top_level.py @@ -159,8 +159,8 @@ class TestCrossDevice(TempDirTestCase): } def setUp(self): - if not os.path.exists('/proc'): - raise unittest.SkipTest('/proc does not exist') + if not os.path.ismount('/proc'): + raise unittest.SkipTest('/proc is not a mountpoint') super(TestCrossDevice, self).setUp() os.symlink('/proc', os.path.join(self.dir, 'test')) -- cgit v1.2.3