def make_test_function(example):

    template, context, expected = example

    def test():
        actual = pystache.render(template, context)
        if actual != expected:
            raise Exception("Benchmark mismatch: \n%s\n*** != ***\n%s" % (expected, actual))

    return test
dataset/ETHPy150Open defunkt/pystache/pystache/tests/benchmark.py/make_test_function/original