Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit 828c3f8

Browse files
authored
Remove docker specific checks (#83)
pytest-molecule tried to be too smart by testing if docker is usable and this proved to work against us: producing failures when user didn't even try to execute a docker scenario.
1 parent d8c5e85 commit 828c3f8

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

pytest_molecule/__init__.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,6 @@ def pytest_configure(config):
8787
"{0}: mark test to run only when {0} is available".format(driver),
8888
)
8989
config.option.molecule[driver] = {"available": True}
90-
if driver == "docker":
91-
try:
92-
import docker # pylint: disable=unused-import,import-outside-toplevel,import-error
93-
94-
# validate docker connectivity
95-
# Default docker value is 60s but we want to fail faster
96-
# With parallel execution 5s proved to give errors.
97-
connection = docker.from_env(timeout=10, version="auto")
98-
if not connection.ping():
99-
raise MoleculeException("Failed to ping docker server.")
100-
101-
except (ImportError, MoleculeException) as exc:
102-
msg = "Molecule {} driver is not available due to: {}.".format(
103-
driver, exc
104-
)
105-
if config.option.molecule_unavailable_driver:
106-
msg += (
107-
" We will tag scenarios using it with '{}' marker.".format(
108-
config.option.molecule_unavailable_driver
109-
)
110-
)
111-
logging.getLogger().warning(msg)
112-
config.option.molecule[driver]["available"] = False
11390

11491
config.addinivalue_line(
11592
"markers", "molecule: mark used by all molecule scenarios"

0 commit comments

Comments
 (0)