From a8a7166e78283ba59f5fec4c9e88ec48b477bc18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 28 Aug 2018 17:45:58 +0200 Subject: [PATCH] Use self.assertRaises as context manager --- tests/test_api/test_nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_api/test_nodes.py b/tests/test_api/test_nodes.py index 0f861c72..631bd475 100644 --- a/tests/test_api/test_nodes.py +++ b/tests/test_api/test_nodes.py @@ -52,8 +52,8 @@ class NodeContentTypeTest(AbstractPillarTest): self.assertNotIn('content_type', db_node['properties']) # PUT it again, without a file -- should be blocked. - self.assertRaises(UnprocessableEntity, self.app.put_internal, 'nodes', node_doc, - _id=node_id) + with self.assertRaises(UnprocessableEntity): + self.app.put_internal('nodes', node_doc, _id=node_id) # PUT it with a file. node_doc['properties']['file'] = str(file_id)