diff options
author | Joffrey F <joffrey@docker.com> | 2018-01-29 19:10:12 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-01-30 14:26:24 -0800 |
commit | 342221130918f4525f01e31d3697cfc077df090e (patch) | |
tree | ecec590176339d863a51d78837c231bb4fa735fd /tests/integration/errors_test.py | |
parent | 4ff296247b4ed9c4afbb0b5293bd4deecb4fe708 (diff) | |
download | docker-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.py | 5 |
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) |