summaryrefslogtreecommitdiff
path: root/tests/integration/errors_test.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-01-29 19:10:12 -0800
committerJoffrey F <joffrey@docker.com>2018-01-30 14:26:24 -0800
commit342221130918f4525f01e31d3697cfc077df090e (patch)
treeecec590176339d863a51d78837c231bb4fa735fd /tests/integration/errors_test.py
parent4ff296247b4ed9c4afbb0b5293bd4deecb4fe708 (diff)
downloaddocker-py-pytest-asserts.tar.gz
Use pytest assertspytest-asserts
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration/errors_test.py')
-rw-r--r--tests/integration/errors_test.py5
1 files changed, 3 insertions, 2 deletions
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)