1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
import pytest
import munch
@pytest.fixture(name='yaml')
def yaml_module():
try:
import yaml # pylint: disable=import-outside-toplevel
return yaml
except ImportError:
pass
pytest.skip("Module 'PyYAML' is required")
@pytest.fixture(params=[munch.Munch, munch.AutoMunch, munch.DefaultMunch, munch.DefaultFactoryMunch,
munch.RecursiveMunch])
def munch_obj(request):
cls = request.param
args = tuple()
if cls == munch.DefaultFactoryMunch:
args = args + (lambda: None,)
return cls(*args, hello="world", number=5)
|