@mark.parametrize('code', exceptions.TYPE_MAP.keys())
def test_raises_exceptions(recwarn, code):
    res = DummyResource()
    res.set_exception_type(code)
    try:
        res.raise_exception()
    except exceptions.WandException as e:
        assert not e.__class__.__name__.endswith('Warning')
        assert str(e) == 'Dummy exception'
    else:
        w = recwarn.pop()
        assert w.category.__name__.endswith('Warning')
        assert "Dummy exception" in str(w.message)
        assert recwarn.list == []
Exceptions raise, and warnings warn
dataset/ETHPy150Open dahlia/wand/tests/_resource_test.py/test_raises_exceptions