def _make_test(modnm):
        def test(self):
            if "PROMISE_SKIP_TIMING_TESTS" not in os.environ:
                sys.stderr.write("running timing test for '%s', please wait\n" % (modnm,))
            mod = getattr(__import__("promise.tests."+modnm).tests,modnm)
            funcs = []
            for funcnm in dir(mod):
                if funcnm.startswith(modnm):
                   funcs.append(funcnm)
            funcs.sort()
            funcnms = ",".join(funcs)
            t0 = self._timeit(modnm,funcnms,funcs[0])
            for funcnm in funcs[1:]:
                t1 = self._timeit(modnm,funcnms,funcnm)
                if "PROMISE_SKIP_TIMING_TESTS" not in os.environ:
                    self.assertTrue(t0 > t1)
                t0 = t1
        test.__name__ = "test_" + modnm
        return test
Make a timing test method from the given module name.
dataset/ETHPy150Open rfk/promise/promise/tests/__init__.py/TestPromiseTiming._make_test