python unittest: can't call decorated test

前端 未结 4 980
广开言路
广开言路 2021-01-12 15:43

I have a pretty large test suite and I decorated some of the test_* functions. Now I can\'t call them by ./test.py MySqlTestCase.test_foo_double, python3.2 comp

4条回答
  •  太阳男子
    2021-01-12 16:20

    I think the problem is that the decorated function doesn't have the same name and, also, it doesn't satisfy the pattern to be considered a test method.

    Using functools.wrap to decorate decorator should fix your problem. More information here.

提交回复
热议问题