Я читал о pytest-ожидаемо и пробовал код, который они дали в качестве примера
import pytest
def test_func(expect):
expect('a' == 'b')
expect(1 != 1)
a = 1
b = 2
expect(a == b, 'a:%s b:%s' % (a,b))
на терминале, который я дал как
py.test test.py
, получая ошибку, как показано ниже
def test_func(expect):
E fixture 'expect' not found
> available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
Нужно ли где-то определять expect
? 1011 *