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 25, 2024
1 parent cc48c36 commit b906ee0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 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,4 @@ def check_array(array, exp_halo, exp_shape, rotate=False):

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

10 changes: 10 additions & 0 deletions devito/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import atexit
from itertools import product
import os
from . import _version

import numpy as np

# Import the global `configuration` dict
from devito.parameters import * # noqa

Expand Down Expand Up @@ -160,6 +163,13 @@ def mode_performance():
configuration['opt-options']['blockinner'] = True


if "PYTEST_VERSION" in os.environ:
# Avoid change in repr break docstring tests
# Only sets it here for testing
# https://numpy.org/devdocs/release/2.0.0-notes.html#representation-of-numpy-scalars-changed # noqa
np.set_printoptions(legacy="1.25")


# Ensure the SymPy caches are purged at exit
# For whatever reason, if we don't do this the garbage collector won't its
# job properly and thus we may end up missing some custom __del__'s
Expand Down

0 comments on commit b906ee0

Please sign in to comment.