def PerfTest(testName):
    """Decorate a unit-test so that it records performance in the global test database"""
    def decorator(f):
        meta = {
            'file': "/".join(inspect.getmodule(f).__name__.split(".")) + ".py",
            'line': inspect.getsourcelines(f)[1]
            }

        def innerTestFun(*args, **kwds):
            t0 = time.time()

            try:
                result = f(*args, **kwds)
            except:
                if isCurrentlyTesting():
                    recordTest(testName, None, meta)
                raise

            if isCurrentlyTesting():
                recordTest(testName, t0 - time.time(), meta)

            return result

        innerTestFun.__name__ = f.__name__
        return innerTestFun

    return decorator
dataset/ETHPy150Open ufora/ufora/ufora/test/PerformanceTestReporter.py/PerfTest/swapped operands of `-`