diff options
author | JPeterMugaas <jpmugaas@suddenlink.net> | 2020-11-04 13:02:50 -0500 |
---|---|---|
committer | JPeterMugaas <jpmugaas@suddenlink.net> | 2020-11-04 13:02:50 -0500 |
commit | 8dcb7573a2c3a469b2182831dc98fbb693fe0f6d (patch) | |
tree | 955b9052b0490a39df6ad26c2f20432edd631d05 | |
parent | a1b1f7c795ace4c186fd76ec6df994deb716cea8 (diff) | |
download | pep8-8dcb7573a2c3a469b2182831dc98fbb693fe0f6d.tar.gz |
Fix tests to handle paths in Windows. NormalizePath works properly but the tests would still fail because NormalizePath would NOT work as the test results expected.
-rw-r--r-- | testsuite/test_shell.py | 2 | ||||
-rw-r--r-- | testsuite/test_util.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/test_shell.py b/testsuite/test_shell.py index 3878194..059d882 100644 --- a/testsuite/test_shell.py +++ b/testsuite/test_shell.py @@ -79,7 +79,7 @@ class ShellTestCase(unittest.TestCase): self.assertFalse(stderr) self.assertEqual(len(stdout), 24) for line, num, col in zip(stdout, (3, 6, 6, 9, 12), (3, 6, 6, 1, 5)): - path, x, y, msg = line.split(':') + path, x, y, msg = line.rsplit(':', 3) self.assertTrue(path.endswith(E11)) self.assertEqual(x, str(num)) self.assertEqual(y, str(col)) diff --git a/testsuite/test_util.py b/testsuite/test_util.py index 8eaba7e..7eff16a 100644 --- a/testsuite/test_util.py +++ b/testsuite/test_util.py @@ -18,6 +18,6 @@ class UtilTestCase(unittest.TestCase): self.assertEqual(normalize_paths('foo,bar'), ['foo', 'bar']) self.assertEqual(normalize_paths('foo, bar '), ['foo', 'bar']) self.assertEqual(normalize_paths('/foo/bar,baz/../bat'), - ['/foo/bar', cwd + '/bat']) + [os.path.realpath('/foo/bar'), cwd + '/bat']) self.assertEqual(normalize_paths(".pyc,\n build/*"), ['.pyc', cwd + '/build/*']) |