def gaussian_rational(draw, nonzero=False):
    real = draw(st.integers())
    imag = draw(st.integers())
    if nonzero:
        assume((real, imag) != (0, 0))
    return GaussianRational(real, imag)
def test_to_gaussian_rational(a):
    assert type(a.to_gaussian_rational) is GaussianRational
    assert a.to_gaussian_rational == GaussianRational(a.real, a.imag)
    assert a.to_gaussian_rational == a