Skip to content

Commit d9d848a

Browse files
committed
Fix two test cases for Python 3.3
1 parent 27cd5cc commit d9d848a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

testsuite/test_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def test_styleguide(self):
118118
stdout = sys.stdout.getvalue().splitlines()
119119
self.assertEqual(len(stdout), report.total_errors)
120120
self.assertEqual(report.total_errors, 1)
121-
self.assertTrue(stdout[0].startswith("missing-file:1:1: E902 IOError"))
121+
# < 3.3 returns IOError; >= 3.3 returns FileNotFoundError
122+
self.assertTrue(stdout[0].startswith("missing-file:1:1: E902 "))
122123
self.assertFalse(sys.stderr)
123124
self.reset()
124125

@@ -289,6 +290,7 @@ def test_styleguide_check_files(self):
289290
self.assertTrue(report.total_errors)
290291

291292
self.assertRaises(TypeError, pep8style.check_files, 42)
292-
self.assertRaises(TypeError, pep8style.check_files, [42])
293+
# < 3.3 raises TypeError; >= 3.3 raises AttributeError
294+
self.assertRaises(Exception, pep8style.check_files, [42])
293295
# TODO: runner
294296
# TODO: input_file

0 commit comments

Comments
 (0)