From 5f4265d53540aca7274b564fc3d863227f0da99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sat, 6 Jun 2015 19:17:41 +0000 Subject: Correct path normalization on Windows: the drive was not normalized (different inputs like "c:\asdf" and "C:\asdf" did not return the same path). --HG-- branch : ionelmc/correct-path-normalization-on-windows-th-1433618255921 --- coverage/files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coverage/files.py b/coverage/files.py index f7fc9693..1feb9b68 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -64,7 +64,7 @@ if env.WINDOWS: head, tail = os.path.split(path) if not tail: - actpath = head + actpath = head.upper() elif not head: actpath = tail else: -- cgit v1.2.1 From 588f3789c29ebf05cfe7b69ae306a40e34f83d1a Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Sun, 7 Jun 2015 03:16:28 +0300 Subject: Add a test for the Windows issue of actual_path. --HG-- branch : ionelmc/correct-path-normalization-on-windows-th-1433618255921 --- tests/test_files.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_files.py b/tests/test_files.py index ae56e728..acf42256 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -5,13 +5,20 @@ import os.path from coverage.files import ( FileLocator, TreeMatcher, FnmatchMatcher, ModuleMatcher, PathAliases, - find_python_files, abs_file + find_python_files, abs_file, actual_path ) from coverage.misc import CoverageException +from coverage import env from tests.coveragetest import CoverageTest +if env.WINDOWS: + class IncompleteWindowsTest(CoverageTest): + def test_actual_path(self): + self.assertEquals(actual_path(r'c:\Windows'), actual_path(r'C:\wINDOWS')) + + class FileLocatorTest(CoverageTest): """Tests of `FileLocator`.""" -- cgit v1.2.1 From 259fae074bbae20dbb0afb3b7790ba923c12f28c Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Sun, 7 Jun 2015 03:43:33 +0300 Subject: Use TestCase here. --HG-- branch : ionelmc/correct-path-normalization-on-windows-th-1433618255921 --- tests/test_files.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_files.py b/tests/test_files.py index acf42256..41f7b38a 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -2,6 +2,7 @@ import os import os.path +from unittest import TestCase from coverage.files import ( FileLocator, TreeMatcher, FnmatchMatcher, ModuleMatcher, PathAliases, @@ -14,7 +15,7 @@ from tests.coveragetest import CoverageTest if env.WINDOWS: - class IncompleteWindowsTest(CoverageTest): + class IncompleteWindowsTest(TestCase): def test_actual_path(self): self.assertEquals(actual_path(r'c:\Windows'), actual_path(r'C:\wINDOWS')) -- cgit v1.2.1 From ce0327fd9c8dadd063eb87aaa77d3d74b4bf409f Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Sun, 7 Jun 2015 03:43:46 +0300 Subject: Make tests run on tox-2.0. --HG-- branch : ionelmc/correct-path-normalization-on-windows-th-1433618255921 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 69d94a0a..c3f55b6a 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ commands = # Build the C extension and test with the CTracer {envpython} setup.py --quiet build_ext --inplace {envpython} igor.py test_with_tracer c {posargs} - +passenv = * deps = nose mock -- cgit v1.2.1 From 3d0e12c982ad2a96e99273d515f79db514092c85 Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Sun, 7 Jun 2015 03:48:27 +0300 Subject: Use the run_in_temp_dir flag. --HG-- branch : ionelmc/correct-path-normalization-on-windows-th-1433618255921 --- tests/test_files.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_files.py b/tests/test_files.py index 41f7b38a..85c7048b 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -2,7 +2,6 @@ import os import os.path -from unittest import TestCase from coverage.files import ( FileLocator, TreeMatcher, FnmatchMatcher, ModuleMatcher, PathAliases, @@ -15,7 +14,9 @@ from tests.coveragetest import CoverageTest if env.WINDOWS: - class IncompleteWindowsTest(TestCase): + class IncompleteWindowsTest(CoverageTest): + run_in_temp_dir = False + def test_actual_path(self): self.assertEquals(actual_path(r'c:\Windows'), actual_path(r'C:\wINDOWS')) -- cgit v1.2.1