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

Commit b5957b8

Browse files
committed
Adopt newer molecule api
Makes pytest-molecule work with the newer api exposed by molecule.
1 parent 6e5e2ac commit b5957b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pytest_molecule/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
import sys
99
from pipes import quote
1010
import yaml
11-
from molecule.config import molecule_drivers
11+
12+
try:
13+
from molecule.api import drivers
14+
except ImportError:
15+
# molecule<3.0
16+
from molecule.api import molecule_drivers as drivers
1217

1318

1419
def pytest_addoption(parser):
@@ -34,7 +39,7 @@ def pytest_addoption(parser):
3439
def pytest_configure(config):
3540

3641
config.option.molecule = {}
37-
for driver in molecule_drivers():
42+
for driver in drivers():
3843
config.addinivalue_line(
3944
"markers", "{0}: mark test to run only when {0} is available".format(driver)
4045
)

0 commit comments

Comments
 (0)