def assert_grammar_typechecking(grammar_types, test_obj):
    class BadType(object):
        pass

    for name, objects in grammar_types:
        for obj in objects:
            tmp_obj = obj()
            setattr(test_obj, name, tmp_obj)
            nt.assert_equal(getattr(test_obj, name), tmp_obj)
            bad_obj = BadType()
            nt.assert_raises_regexp(ValueError, name + '.*' + obj.__name__,
                                    setattr, test_obj, name, bad_obj)
            nt.assert_equal(getattr(test_obj, name), tmp_obj)
.pkginfo_from_file with unrecognized extension
dataset/ETHPy150Open wrobstory/vincent/tests/test_vega.py/assert_grammar_typechecking--crossover with--dataset/ETHPy150Open SMFOSS/CheesePrism/tests/test_index.py/ClassOrStaticMethods.test_pkginfo_from_bad_ext