From cbbc37ac7b508d1a84ad68fa043f25f99d17b602 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Wed, 14 Feb 2018 13:01:16 +0000 Subject: [PATCH] Clean up created volume from test_run_with_named_volume This fix adds the volume id to the list so that it could be cleaned up on test teardown. The issue was originally from https://github.com/moby/moby/pull/36292 where an additional `somevolume` pre-exists in tests. Signed-off-by: Yong Tang --- tests/integration/models_containers_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/models_containers_test.py b/tests/integration/models_containers_test.py index a4d9f9c0..f9f59c43 100644 --- a/tests/integration/models_containers_test.py +++ b/tests/integration/models_containers_test.py @@ -55,7 +55,8 @@ class ContainerCollectionTest(BaseIntegrationTest): def test_run_with_named_volume(self): client = docker.from_env(version=TEST_API_VERSION) - client.volumes.create(name="somevolume") + volume = client.volumes.create(name="somevolume") + self.tmp_volumes.append(volume.id) container = client.containers.run( "alpine", "sh -c 'echo \"hello\" > /insidecontainer/test'",