1from __future__ import print_function 2 3import doctest 4import os 5import sys 6import pytest 7 8import munch 9 10_HERE = os.path.abspath(os.path.dirname(__file__)) 11_README_PATH = os.path.join(_HERE, '..', 'README.md') 12assert os.path.exists(_README_PATH) 13 14 15@pytest.mark.skipif(sys.version_info[:2] < (3, 6), reason="Requires Python version >= 3.6") 16@pytest.mark.usefixtures("yaml") 17def test_readme(): 18 globs = { 19 'print_function': print_function, 20 'munch': munch, 21 'Munch': munch.Munch, 22 'DefaultMunch': munch.DefaultMunch, 23 'DefaultFactoryMunch': munch.DefaultFactoryMunch, 24 } 25 result = doctest.testfile(_README_PATH, module_relative=False, globs=globs) 26 assert not result.failed 27