def test_required_fail(): with pytest.raises(RuntimeError) as excinfo: dep.required('bleepbloop', 'nope') assert 'nope' in str(excinfo.value)
def test_required_success(): assert dep.required('sys', 'yep') is not None