2
상세한 검사 모드에서 pycharm에서 unittests를 실행하는 방법이 있습니까? 나는 테스트 테스트에서 docstring을 볼 수있는 방법을 찾고 있는데, 나는 run 테스트에 대한 정보를 볼 수있다.자세한 검사 모드에서 unittest를 실행하는 Pycharm
class KnownValues(unittest.TestCase):
known_values = (
([1, 2],[[1, 2]]),
([1, 2, 3], [[1, 2], [1, 2, 3]]),
([1, 2, 3, 4],[[1, 2], [1, 2, 3, 4]]),
([1, 2, 3, 4, 5],[[1, 2], [1, 2, 3], [1, 2, 3, 4, 5]]),
([1, 2, 3, 4, 5, 6],[[1, 2], [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5, 6]]),
)
def test_check(self):
'''This should check is the function returning right'''
for arg, result in self.known_values:
print("Testing arg:{}".format(arg))
assert program.lister(arg) == result
if __name__ == '__main__':
unittest.main()
이 반환
Testing started at 19:38 ч. ...
Testing arg:[1, 2]
Process finished with exit code 0
내가 싶어 :
당신이해야 할 모든이setUp
방법을 사용하고이 같은
_testMethodDoc
속성을 호출하는 것입니다
test_check (__main__.KnownValues)
This should check is the function returning right ... Testing arg:[1, 2]
ok
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK