Skip to content

Commit

Permalink
fix-test
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammad-alisafaee committed May 31, 2023
1 parent 88c89be commit e8c01b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/cli/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import pytest

import renku.core.session.docker
from renku.ui.cli import cli
from tests.utils import format_result_exception

Expand Down Expand Up @@ -85,12 +86,11 @@ def test_session_start_config_requests(runner, project, dummy_session_provider,

def test_session_start_with_docker_args(runner, project, dummy_session_provider, monkeypatch):
"""Test passing docker run arguments to session start."""
import docker

with monkeypatch.context() as monkey:
docker_client = MagicMock()
docker_client.api.inspect_image.return_value = {}
monkey.setattr(docker, "from_env", lambda: docker_client)
# NOTE: Patching ``docker.from_env`` won't work in CI since ``docker`` is imported before this test
monkey.setattr(renku.core.session.docker.docker, "from_env", lambda: docker_client)

result = runner.invoke(
cli,
Expand Down

0 comments on commit e8c01b7

Please sign in to comment.