def test_raise_common_default(): with pytest.raises(BatfishAssertException) as e: _raise_common("foobar") assert "foobar" in str(e.value) with pytest.raises(BatfishAssertException) as e: _raise_common("foobaragain", False) assert "foobaragain" in str(e.value)
def test_raise_common_warn(): with pytest.warns(BatfishAssertWarning): _raise_common("foobar", True)
def test_raise_common_warn(): with pytest.warns(BatfishAssertWarning): result = _raise_common("foobar", True) assert not result