pip install pytest
test_basic.py
와 같이 접두사로 test_
를 붙이거나 test.py로 끝나야 한다def test_simple()
과 같이 접두사로 test_
가 붙어야 한다def test_method(self)
와 같이 test_
가 접두사로 붙는다
import pytest from my_module import string_to_bool true_valus=['yes','1','Yes','TRUE', 'TruE', 'True', 'true'] class TestStrToBool(object): @pytest.mark.parameterize('value', true_values) def test_it_detects_truish_strings(self, value) assert string_to_bool(value)