하위 디렉토리의 모든 테스트를 실행하고 싶을 때가 있다.
그럴때는
$ python -m unittest discover
를 입력하면 하위 디렉토리의 모든 테스트를 실행한다. (기본적으로 "test*.py" 포맷의 파일을 찾아 실행한다.)
$ python -m unittest discover
F.
======================================================================
FAIL: test_failure (test2.HelloTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\workspace\study\TIL\test2.py", line 9, in test_failure
self.assertEqual(0,1)
AssertionError: 0 != 1
----------------------------------------------------------------------
Ran 2 tests in 0.001s
FAILED (failures=1)
'Python' 카테고리의 다른 글
[Python] metaclass 란 (0) | 2022.06.06 |
---|---|
TypeError: 'property' object is not iterable (0) | 2021.06.02 |
[Django] Django duplicate app name "auth" (0) | 2021.05.22 |
[Django ] Django TypeError: send_mail() missing 1 required positional argument: 'from_email' (0) | 2021.05.22 |
[Python] namespace란 (0) | 2021.05.12 |