diff --git a/tests/integration/models_containers_test.py b/tests/integration/models_containers_test.py index c65f3d7f8..6b9bfb8c9 100644 --- a/tests/integration/models_containers_test.py +++ b/tests/integration/models_containers_test.py @@ -353,6 +353,15 @@ def test_exec_run_success(self): assert exec_output[0] == 0 assert exec_output[1] == b"hello\n" + def test_exec_run_error_code_from_exec(self): + client = docker.from_env(version=TEST_API_VERSION) + container = client.containers.run( + "alpine", "sleep 20'", detach=True + ) + self.tmp_containers.append(container.id) + exec_output = container.exec_run("exit 42") + assert exec_output[0] == 42 + def test_exec_run_failed(self): client = docker.from_env(version=TEST_API_VERSION) container = client.containers.run(