diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-09-29 14:36:06 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-09-29 14:36:06 -0400 |
commit | 5a3f14d192a50638a9d3c0744384220e91b517e6 (patch) | |
tree | 3b556d312e55b454a901256b6d345096864e61d8 /test/test_files.py | |
parent | 56436f20ee79b6f295251aa88ee9691c9f92c511 (diff) | |
download | python-coveragepy-git-5a3f14d192a50638a9d3c0744384220e91b517e6.tar.gz |
Fix this test on windows.
Diffstat (limited to 'test/test_files.py')
-rw-r--r-- | test/test_files.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_files.py b/test/test_files.py index ba8a06ba..f2f3581e 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) |