From: Tim Golden Date: Thu, 1 Aug 2013 12:58:58 +0000 (+0100) Subject: issue9035: Prevent Windows-specific tests from running on non-Windows platforms X-Git-Tag: v3.4.0a1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2fcebb018740eb69f083e0d98abe0c23dc0e026;p=python issue9035: Prevent Windows-specific tests from running on non-Windows platforms --- diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 66fcf2747f..285ef62a46 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -274,22 +274,22 @@ class TestNtpath(unittest.TestCase): with support.temp_dir() as d: self.assertFalse(ntpath.ismount(d)) - # - # Make sure the current folder isn't the root folder - # (or any other volume root). The drive-relative - # locations below cannot then refer to mount points - # - drive, path = ntpath.splitdrive(sys.executable) - with support.change_cwd(os.path.dirname(sys.executable)): - self.assertFalse(ntpath.ismount(drive.lower())) - self.assertFalse(ntpath.ismount(drive.upper())) - - self.assertTrue(ntpath.ismount("\\\\localhost\\c$")) - self.assertTrue(ntpath.ismount("\\\\localhost\\c$\\")) - - self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$")) - self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$\\")) - + if sys.platform == "win32": + # + # Make sure the current folder isn't the root folder + # (or any other volume root). The drive-relative + # locations below cannot then refer to mount points + # + drive, path = ntpath.splitdrive(sys.executable) + with support.change_cwd(os.path.dirname(sys.executable)): + self.assertFalse(ntpath.ismount(drive.lower())) + self.assertFalse(ntpath.ismount(drive.upper())) + + self.assertTrue(ntpath.ismount("\\\\localhost\\c$")) + self.assertTrue(ntpath.ismount("\\\\localhost\\c$\\")) + + self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$")) + self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$\\")) class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase): pathmodule = ntpath