summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2013-03-02 18:54:42 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2013-03-02 18:54:42 +0100
commitd9d848a295bbf98844ad48ebb7b687c0f266a751 (patch)
tree98937fede217de66dd5b99285166acbc4ca1c4a0 /testsuite
parent27cd5cce4741f7f23dd970e8648ace9030b41fbc (diff)
downloadpep8-d9d848a295bbf98844ad48ebb7b687c0f266a751.tar.gz
Fix two test cases for Python 3.3
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/test_api.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/testsuite/test_api.py b/testsuite/test_api.py
index 8cde061..a31ff42 100644
--- a/testsuite/test_api.py
+++ b/testsuite/test_api.py
@@ -118,7 +118,8 @@ class APITestCase(unittest.TestCase):
stdout = sys.stdout.getvalue().splitlines()
self.assertEqual(len(stdout), report.total_errors)
self.assertEqual(report.total_errors, 1)
- self.assertTrue(stdout[0].startswith("missing-file:1:1: E902 IOError"))
+ # < 3.3 returns IOError; >= 3.3 returns FileNotFoundError
+ self.assertTrue(stdout[0].startswith("missing-file:1:1: E902 "))
self.assertFalse(sys.stderr)
self.reset()
@@ -289,6 +290,7 @@ class APITestCase(unittest.TestCase):
self.assertTrue(report.total_errors)
self.assertRaises(TypeError, pep8style.check_files, 42)
- self.assertRaises(TypeError, pep8style.check_files, [42])
+ # < 3.3 raises TypeError; >= 3.3 raises AttributeError
+ self.assertRaises(Exception, pep8style.check_files, [42])
# TODO: runner
# TODO: input_file