diff options
author | Ian Cordasco <sigmavirus24@users.noreply.github.com> | 2015-09-07 10:35:13 -0500 |
---|---|---|
committer | Ian Cordasco <sigmavirus24@users.noreply.github.com> | 2015-09-07 10:35:13 -0500 |
commit | 7ebcfeb9eb2a96149393331bad4a0f9c219409de (patch) | |
tree | c386014a00010ee6d13dc69c52f538c4c1e23e2e | |
parent | 237e49ddf9e675ee44a715ac45b649d55973be40 (diff) | |
parent | 24c2aa82e00f83c1cb9f2bb8fb61a75125b46d7f (diff) | |
download | pyflakes-7ebcfeb9eb2a96149393331bad4a0f9c219409de.tar.gz |
Merge pull request #33 from alexandrul/master
Fix test_api.py on Windows
-rw-r--r-- | pyflakes/test/test_api.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py index a83a7fd..34a59bc 100644 --- a/pyflakes/test/test_api.py +++ b/pyflakes/test/test_api.py @@ -15,7 +15,7 @@ from pyflakes.api import ( checkRecursive, iterSourceCode, ) -from pyflakes.test.harness import TestCase +from pyflakes.test.harness import TestCase, skipIf if sys.version_info < (3,): from cStringIO import StringIO @@ -419,6 +419,7 @@ foo = '\\xyz' self.assertHasErrors( sourcePath, [decoding_error]) + @skipIf(sys.platform == 'win32', 'unsupported on Windows') def test_permissionDenied(self): """ If the source file is not readable, this is reported on standard @@ -583,7 +584,7 @@ class IntegrationTests(TestCase): fd.close() d = self.runPyflakes([self.tempfilepath]) expected = UnusedImport(self.tempfilepath, Node(1), 'contraband') - self.assertEqual(d, ("%s\n" % expected, '', 1)) + self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1)) def test_errors(self): """ @@ -592,7 +593,8 @@ class IntegrationTests(TestCase): printed to stderr. """ d = self.runPyflakes([self.tempfilepath]) - error_msg = '%s: No such file or directory\n' % (self.tempfilepath,) + error_msg = '%s: No such file or directory%s' % (self.tempfilepath, + os.linesep) self.assertEqual(d, ('', error_msg, 1)) def test_readFromStdin(self): @@ -601,4 +603,4 @@ class IntegrationTests(TestCase): """ d = self.runPyflakes([], stdin='import contraband'.encode('ascii')) expected = UnusedImport('<stdin>', Node(1), 'contraband') - self.assertEqual(d, ("%s\n" % expected, '', 1)) + self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1)) |