Как я могу написать pytest для этой функции, используя python.
def func(name): return 'first' in name or 'second' in name
Просто проверить достоверность вывода?
def test_func(): assert func("first") assert func("second") assert not func("last")
def func(name): return 'first' in name or 'second' in name def test_func(): true_first_condition = func(name="first name") assert true_first_condition is True false_first_condition = func(name="last name") assert false_first_condition is False true_second_condition = func(name="second name") assert true_second_condition is True false_second_condition = func(name="last name") assert false_second_condition is False all_condition = func(name="first second") assert all_condition is True