From 342221130918f4525f01e31d3697cfc077df090e Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Mon, 29 Jan 2018 19:10:12 -0800 Subject: Use pytest asserts Signed-off-by: Joffrey F --- tests/integration/errors_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/integration/errors_test.py') diff --git a/tests/integration/errors_test.py b/tests/integration/errors_test.py index dc5cef4..ac74d72 100644 --- a/tests/integration/errors_test.py +++ b/tests/integration/errors_test.py @@ -1,14 +1,15 @@ from docker.errors import APIError from .base import BaseAPIIntegrationTest, BUSYBOX +import pytest class ErrorsTest(BaseAPIIntegrationTest): def test_api_error_parses_json(self): container = self.client.create_container(BUSYBOX, ['sleep', '10']) self.client.start(container['Id']) - with self.assertRaises(APIError) as cm: + with pytest.raises(APIError) as cm: self.client.remove_container(container['Id']) - explanation = cm.exception.explanation + explanation = cm.value.explanation assert 'You cannot remove a running container' in explanation assert '{"message":' not in explanation self.client.remove_container(container['Id'], force=True) -- cgit v1.2.1