From 4427e850df34890e8df8990608c4a48e296348ac Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 29 Sep 2012 14:36:06 -0400 Subject: Fix this test on windows. --- test/test_files.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/test_files.py') diff --git a/test/test_files.py b/test/test_files.py index ba8a06b..f2f3581 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -39,9 +39,13 @@ class FileLocatorTest(CoverageTest): def test_filepath_contains_absolute_prefix_twice(self): # https://bitbucket.org/ned/coveragepy/issue/194/filelocatorrelative_filename-could-mangle + # Build a path that has two pieces matching the absolute path prefix. + # Technically, this test doesn't do that on Windows, but drive + # letters make that impractical to acheive. fl = FileLocator() d = fl.abs_file(os.curdir) - rel = os.path.join('sub', d.lstrip(os.path.sep), 'file1.py') + trick = os.path.splitdrive(d)[1].lstrip(os.path.sep) + rel = os.path.join('sub', trick, 'file1.py') self.assertEqual(fl.relative_filename(fl.abs_file(rel)), rel) -- cgit v1.2.1