diff options
author | Tim Golden <mail@timgolden.me.uk> | 2013-08-01 12:58:58 (GMT) |
---|---|---|
committer | Tim Golden <mail@timgolden.me.uk> | 2013-08-01 12:58:58 (GMT) |
commit | b2fcebb018740eb69f083e0d98abe0c23dc0e026 (patch) | |
tree | 11025141f3e31c4c2c089845e33e92bc46eed04f /Lib/test/test_ntpath.py | |
parent | 6b528067c50b9dbf1c53fbc8b6fa959050c5dfcd (diff) | |
download | cpython-b2fcebb018740eb69f083e0d98abe0c23dc0e026.zip cpython-b2fcebb018740eb69f083e0d98abe0c23dc0e026.tar.gz cpython-b2fcebb018740eb69f083e0d98abe0c23dc0e026.tar.bz2 |
issue9035: Prevent Windows-specific tests from running on non-Windows platforms
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r-- | Lib/test/test_ntpath.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 66fcf27..285ef62 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 |