

def test_wrapper(self):

    @stats.wrapper('foo')
    def foofunc(arg):
        self.assertTrue(arg)
        return arg
    foofunc(True)
    lines = [mockserver.readline() for i in range(2)]
    self.assertIn('foo.calls:1|c', lines)
    self.assertNotIn('foo.exceptions:1|c', lines)
    self.assertEqual(len([x for x in lines if re.match('^foo.duration:[0-9\\.]+|ms$', i)]), 1)

dataset/ETHPy150Open uber/clay/tests/test_stats.py TestStats.test_wrapper/VarMisuse@97/139 `x`->`i`