def c(request): '''Config fixture. Return a config object for easy attribute access''' c = Config('''\ prog: test_loadconfig.py test_version: 0.1.7 conf: | version: $test_version clg: description: Build a full system options: version: short: v action: version version: $prog $test_version args: host: help: Host to build args: nargs: '*' help: extra arguments checkconfig: | import re if re.search('[^\d\w]', '$host'): raise Exception() system_path: /data/salt/system docker__image: reg.gdl/debian ''') # prog and version configs are hardcoded as this test runs in testsuite # Declare PYTHONPATH to use loadconfig package from this project c.project_path = dirname(ppath(__file__)) c.loadconfig_cmd = 'PYTHONPATH={0} {0}/scripts/loadconfig'.format( c.project_path) return c