Skip to content

Fixed skipping code execution in docker test if already running in a container #1383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down