summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_datastructures.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils_tests/test_datastructures.py')
-rw-r--r--tests/utils_tests/test_datastructures.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/utils_tests/test_datastructures.py b/tests/utils_tests/test_datastructures.py
index d151f12bb5..c90ef470bb 100644
--- a/tests/utils_tests/test_datastructures.py
+++ b/tests/utils_tests/test_datastructures.py
@@ -108,8 +108,8 @@ class ImmutableListTests(SimpleTestCase):
d = ImmutableList(range(10))
# AttributeError: ImmutableList object is immutable.
- self.assertRaisesMessage(AttributeError,
- 'ImmutableList object is immutable.', d.sort)
+ with self.assertRaisesMessage(AttributeError, 'ImmutableList object is immutable.'):
+ d.sort()
self.assertEqual(repr(d), '(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)')
@@ -119,8 +119,8 @@ class ImmutableListTests(SimpleTestCase):
self.assertEqual(d[1], 1)
# AttributeError: Object is immutable!
- self.assertRaisesMessage(AttributeError,
- 'Object is immutable!', d.__setitem__, 1, 'test')
+ with self.assertRaisesMessage(AttributeError, 'Object is immutable!'):
+ d.__setitem__(1, 'test')
class DictWrapperTests(SimpleTestCase):