diff options
Diffstat (limited to 'tests/integration/models_images_test.py')
-rw-r--r-- | tests/integration/models_images_test.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/integration/models_images_test.py b/tests/integration/models_images_test.py index 94164ce..9313916 100644 --- a/tests/integration/models_images_test.py +++ b/tests/integration/models_images_test.py @@ -21,16 +21,15 @@ class ImageCollectionTest(BaseIntegrationTest): # @pytest.mark.xfail(reason='Engine 1.13 responds with status 500') def test_build_with_error(self): client = docker.from_env(version=TEST_API_VERSION) - with self.assertRaises(docker.errors.BuildError) as cm: + with pytest.raises(docker.errors.BuildError) as cm: client.images.build(fileobj=io.BytesIO( "FROM alpine\n" "RUN exit 1".encode('ascii') )) - print(cm.exception) - assert str(cm.exception) == ( + assert ( "The command '/bin/sh -c exit 1' returned a non-zero code: 1" - ) - assert cm.exception.build_log + ) in cm.exconly() + assert cm.value.build_log def test_build_with_multiple_success(self): client = docker.from_env(version=TEST_API_VERSION) |