def test_expect(): o = Ok('yay') n = Err('nay') assert o.expect('failure') == 'yay' with pytest.raises(UnwrapError): n.expect('failure')