Skip to content

Commit 01b2a86

Browse files
authored
Skip test_autobahn if python_on_whales is missing (#10597)
1 parent b144a1c commit 01b2a86

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/autobahn/test_autobahn.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
import subprocess
33
import sys
44
from pathlib import Path
5-
from typing import Any, Dict, Generator, List
5+
from typing import TYPE_CHECKING, Any, Dict, Generator, List
66

77
import pytest
88
from pytest import TempPathFactory
9-
from python_on_whales import DockerException, docker
9+
10+
if TYPE_CHECKING:
11+
from python_on_whales import DockerException, docker
12+
else:
13+
python_on_whales = pytest.importorskip("python_on_whales")
14+
DockerException = python_on_whales.DockerException
15+
docker = python_on_whales.docker
1016

1117

1218
@pytest.fixture(scope="session")

0 commit comments

Comments
 (0)