Skip to content

Commit aa85be9

Browse files
committed
fix docker_image test when ubuntu:22.04 image is not pre-pulled
1 parent 1027596 commit aa85be9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/languages/docker_image_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
from __future__ import annotations
22

3+
import pytest
4+
35
from pre_commit.languages import docker_image
6+
from pre_commit.util import cmd_output_b
47
from testing.language_helpers import run_language
58
from testing.util import xfailif_windows
69

710

11+
@pytest.fixture(autouse=True, scope='module')
12+
def _ensure_image_available():
13+
cmd_output_b('docker', 'run', '--rm', 'ubuntu:22.04', 'echo')
14+
15+
816
@xfailif_windows # pragma: win32 no cover
917
def test_docker_image_hook_via_entrypoint(tmp_path):
1018
ret = run_language(

0 commit comments

Comments
 (0)