summaryrefslogtreecommitdiff
path: root/test/test_files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-09-29 14:36:06 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-09-29 14:36:06 -0400
commit4427e850df34890e8df8990608c4a48e296348ac (patch)
treed85e5c55c1efab306f9172a82cc12ccdf5b6bd8f /test/test_files.py
parent163ea988b76a0e2adbdbce05ee4bf546af214502 (diff)
downloadpython-coveragepy-4427e850df34890e8df8990608c4a48e296348ac.tar.gz
Fix this test on windows.
Diffstat (limited to 'test/test_files.py')
-rw-r--r--test/test_files.py6
1 files changed, 5 insertions, 1 deletions
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)