def pytest_generate_tests(metafunc):
    # global clean_input
    # clean_input = get_clean_input(metafunc.config)
    test_count = get_testcount(metafunc.config)
    if 'kosh_entry' in metafunc.fixturenames:
        kosh_entries = get_kosh_entries(test_count)
        metafunc.parametrize("kosh_entry", kosh_entries)
Esempio n. 2
0
def pytest_generate_tests(metafunc):
    test_count = get_testcount(metafunc.config)
    if 'join_reference' in metafunc.fixturenames:
        join_references = load_reference_data("sandhi_join_passing.txt",
                                              "sandhi_join_failing.txt",
                                              test_count / 2)
        metafunc.parametrize("join_reference", join_references)
    if 'split_reference' in metafunc.fixturenames:
        split_references = load_reference_data("sandhi_split_passing.txt",
                                               "sandhi_split_failing.txt",
                                               test_count / 2)
        metafunc.parametrize("split_reference", split_references)
Esempio n. 3
0
def pytest_generate_tests(metafunc):
    test_count = get_testcount(metafunc.config)
    if 'parse_entry' in metafunc.fixturenames:
        base_dir = os.path.dirname(os.path.abspath(
            inspect.getfile(inspect.currentframe())))
        data_dir = os.path.join(base_dir, 'parser')
        manual_file = open(os.path.join(data_dir, "golden.conll"), "rt")
        if test_count > 0:
            parse_entries = itertools.islice(conll_tests(manual_file), test_count)
        else:
            parse_entries = conll_tests(manual_file)
        metafunc.parametrize("parse_entry", list(parse_entries))
        manual_file.close()
def pytest_generate_tests(metafunc):
    test_count = get_testcount(metafunc.config)
    if 'splittext_refs' in metafunc.fixturenames:
        splittext_refs = get_splitstxt(test_count)
        metafunc.parametrize("splittext_refs", splittext_refs)