Skip to content

Commit

Permalink
CI: tweak docstring test to avoid repr issues on some system
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jun 22, 2024
1 parent cc48c36 commit 6f62670
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import pytest
from sympy import Add
import numpy as np
from IPython import get_ipython

from devito import Eq, configuration, Revolver # noqa
from devito.checkpointing import NoopRevolver
Expand Down Expand Up @@ -453,3 +455,10 @@ def check_array(array, exp_halo, exp_shape, rotate=False):

assert tuple(array.halo) == exp_halo
assert tuple(shape) == tuple(exp_shape)


# Make Ipython use str for numpy dtypes
for nptype in [np.int32, np.int64, np.float32, np.float64]:
if get_ipython() is not None:
formatter = get_ipython().display_formatter.formatters['text/plain']
formatter.for_type(nptype, lambda n, p, cycle: p.text("%X" % n))

0 comments on commit 6f62670

Please sign in to comment.