Skip to content

Commit

Permalink
Skip mpmath test if module not available
Browse files Browse the repository at this point in the history
Since gmpy2 is a build dependency for mpmath, this
allows testing gmpy2 before mpmath is built.
  • Loading branch information
tornaria committed Oct 1, 2023
1 parent 0436f5a commit 8e4bb7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_mpfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
from hypothesis import given, example, settings
from hypothesis.strategies import floats
import mpmath

import gmpy2
from gmpy2 import (gamma_inc, mpfr, cmp, cmp_abs, zero, nan, mpz, mpq,
Expand Down Expand Up @@ -123,6 +122,7 @@ def test_mpfr_nrandom():


def test_mpfr_mpmath():
mpmath = pytest.importorskip("mpmath")
a, b, c, d = '1.1', '-1.1', '-3.14', '0'
assert mpfr(a)._mpf_ == (0, mpz(4953959590107546), -52, 53)
assert mpmath.mpf(mpfr(a)) == mpmath.mpf(a)
Expand Down

0 comments on commit 8e4bb7c

Please sign in to comment.