def test_page_should_not_contain_any_string_fails(mocker: MockerFixture, under_test: x3270): mocker.patch("Mainframe3270.py3270.Emulator.string_get", return_value="abc") with pytest.raises(Exception, match='The string "abc" was found'): under_test.page_should_not_contain_any_string(["abc", "def"])
def test_page_should_not_contain_any_string_custom_message( mocker: MockerFixture, under_test: x3270): mocker.patch("Mainframe3270.py3270.Emulator.string_get", return_value="abc") with pytest.raises(Exception, match="my error message"): under_test.page_should_not_contain_any_string( ["abc", "def"], error_message="my error message")
def test_page_should_not_contain_any_string(mocker: MockerFixture, under_test: x3270): mocker.patch("Mainframe3270.py3270.Emulator.string_get", return_value="abc") under_test.page_should_not_contain_any_string(["def", "ghi"])