conftest.py 321 B

1234567891011121314151617
  1. """
  2. This conftest is required to set the numpy print options
  3. to legacy mode for doctests
  4. """
  5. import pytest
  6. @pytest.fixture(autouse=True)
  7. def handle_np2():
  8. # TODO: remove when we require numpy >= 2
  9. try:
  10. import numpy as np
  11. np.set_printoptions(legacy="1.21")
  12. except ImportError:
  13. pass