def generate_params(fixtures_dirname): for html_path in (Path(__file__).parent / fixtures_dirname).rglob('*.html'): if startswith_skip(html_path): yield param_startswith_skip(html_path) else: yml_path = html_path.with_suffix('.yml') if startswith_skip(yml_path): yield param_startswith_skip(yml_path) elif yml_path.is_file(): yield pytest.param(html_path.read_text(), load_yaml(yml_path.read_text(), schema), id=html_path.name) # better readability else: yield param_xfail_missing(yml_path)
def generate_params(fixtures_dirname): for path in (Path(__file__).parent / fixtures_dirname).rglob('*.html'): if startswith_skip(path): yield param_startswith_skip(path) else: name = path.name.split(path.suffix)[0] lang = name.split('_')[0] yield pytest.param(path.read_text(), lang, id=name)
def generate_params(fixtures_dirname): for path in (Path(__file__).parent / fixtures_dirname).rglob('*.html'): if startswith_skip(path): yield param_startswith_skip(path) else: yield pytest.param(path.read_text(), id=path.name)