摘要:
import pytest @pytest.fixture def login(): print("登录操作") username = "xuefeifei" return username class TestDemo: def test_a(self,login): print(f"a name 阅读全文
摘要:
@pytest.mark.parametrize("a,b",[(1,2),(5,8),(8,0)]) def test_answer(a,b): assert func(a) == b 另外可以用 元组或者列表 @pytest.mark.parametrize(("a","b"),[(1,2),( 阅读全文