python:pytest
Python: pytest
기본 사용법1)
# test_wallet.py @pytest.fixture def my_wallet(): '''Returns a Wallet instance with a zero balance''' return Wallet() @pytest.mark.parametrize("earned,spent,expected", [ (30, 10, 20), (20, 2, 18), ]) def test_transactions(my_wallet, earned, spent, expected): my_wallet.add_cash(earned) my_wallet.spend_cash(spent) assert my_wallet.balance == expected
Python Test Runner
python/pytest.txt · 마지막으로 수정됨: 2024/03/23 02:42 저자 127.0.0.1