-
Notifications
You must be signed in to change notification settings - Fork 0
Unit Test
GitDeveloperKim edited this page May 16, 2022
·
20 revisions
unittest official doc
unittest official korean
unittest
unittest blog
coverage
unittest.mock
pytest doc
파이썬 단위 테스트에 대한 개념 블로그 link
목에 대한 개념 블로그 link
mock 패치에 대한 블로그 link
- python -m pip install coverage
- 단위테스트
python -m unittest -v TestCalculator.py - 커버리지
coverage report
coverage html
coverage run --source=src --omit="./test/Test_" -m unittest discover .\test\Test.py
from unittest.mock import MagicMock
class testClass():
def method(parameter_list):
pass
test_class = testClass()
test_class.method = MagicMock(return_value=10)
test = test_class.method(1, 2, 3, key='value')
print(test)