diff --git a/tests/test_functions.py b/tests/test_functions.py index 7b81c59..ef03333 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -1,15 +1,25 @@ import math +import pytest from hypothesis import given from hypothesis.strategies import integers -from gmp import mpz, gcd, isqrt +from gmp import mpz, factorial, gcd, isqrt @given(integers(min_value=0)) def test_isqrt(x): mx = mpz(x) - assert isqrt(mx) == isqrt(x) == math.isqrt(x) + r = math.isqrt(x) + assert isqrt(mx) == isqrt(x) == r + + +@pytest.mark.xfail(reason="diofant/python-gmp#12") +@given(integers(min_value=0, max_value=12345)) +def test_factorial(x): + mx = mpz(x) + r = math.factorial(x) + assert factorial(mx) == factorial(x) == r @given(integers(), integers())