summaryrefslogtreecommitdiff
path: root/tests/test_string_asserts.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-07 17:42:01 +0200
committerGeorg Brandl <georg@python.org>2014-10-07 17:42:01 +0200
commit52abd65f03505ef10fbe4e517f615b2805baddf2 (patch)
tree485bb5b545848fce40f6ad65682af6166c924805 /tests/test_string_asserts.py
parent06af846e38aa39e526454c215d80fe0edef50e9d (diff)
downloadpygments-52abd65f03505ef10fbe4e517f615b2805baddf2.tar.gz
Closes #1041: Fix test suite to pass under Python 2.6.
Diffstat (limited to 'tests/test_string_asserts.py')
-rw-r--r--tests/test_string_asserts.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/test_string_asserts.py b/tests/test_string_asserts.py
index 0beed15c..90d81d67 100644
--- a/tests/test_string_asserts.py
+++ b/tests/test_string_asserts.py
@@ -17,23 +17,19 @@ class TestStringTests(StringTests, unittest.TestCase):
# @unittest.expectedFailure not supported by nose
def test_startswith_incorrect(self):
- with self.assertRaises(AssertionError):
- self.assertStartsWith("AAA", "B")
+ self.assertRaises(AssertionError, self.assertStartsWith, "AAA", "B")
# @unittest.expectedFailure not supported by nose
def test_startswith_short(self):
- with self.assertRaises(AssertionError):
- self.assertStartsWith("A", "AA")
+ self.assertRaises(AssertionError, self.assertStartsWith, "A", "AA")
def test_endswith_correct(self):
self.assertEndsWith("AAA", "A")
# @unittest.expectedFailure not supported by nose
def test_endswith_incorrect(self):
- with self.assertRaises(AssertionError):
- self.assertEndsWith("AAA", "B")
+ self.assertRaises(AssertionError, self.assertEndsWith, "AAA", "B")
# @unittest.expectedFailure not supported by nose
def test_endswith_short(self):
- with self.assertRaises(AssertionError):
- self.assertEndsWith("A", "AA")
+ self.assertRaises(AssertionError, self.assertEndsWith, "A", "AA")