From 2649db2c8db11c795d162be97ade088097dda1a6 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 24 Jan 2024 00:38:52 +0100 Subject: [PATCH] fixed skipping code execution in docker test if already runnning in a container (#1383) --- test/test_code.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_code.py b/test/test_code.py index cf3d7f27a9c1..7455bae9e80e 100644 --- a/test/test_code.py +++ b/test/test_code.py @@ -359,7 +359,8 @@ def test_execute_code(use_docker=None): @pytest.mark.skipif( - sys.platform in ["win32"] or (not is_docker_running() and not in_docker_container()), reason="docker is not running" + sys.platform in ["win32"] or (not is_docker_running()) or in_docker_container(), + reason="docker is not running or in docker container already", ) def test_execute_code_with_custom_filename_on_docker(): exit_code, msg, image = execute_code("print('hello world')", filename="tmp/codetest.py", use_docker=True) @@ -368,7 +369,8 @@ def test_execute_code_with_custom_filename_on_docker(): @pytest.mark.skipif( - sys.platform in ["win32"] or (not is_docker_running() and not in_docker_container()), reason="docker is not running" + sys.platform in ["win32"] or (not is_docker_running()) or in_docker_container(), + reason="docker is not running or in docker container already", ) def test_execute_code_with_misformed_filename_on_docker(): exit_code, msg, image = execute_code(