diff options
Diffstat (limited to 'numpy/random/tests/test_direct.py')
-rw-r--r-- | numpy/random/tests/test_direct.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/random/tests/test_direct.py b/numpy/random/tests/test_direct.py index 0f57c4bd4..dad12c8a8 100644 --- a/numpy/random/tests/test_direct.py +++ b/numpy/random/tests/test_direct.py @@ -1,5 +1,6 @@ import os from os.path import join +import sys import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_array_equal, @@ -10,7 +11,7 @@ from numpy.random import ( Generator, MT19937, PCG64, Philox, RandomState, SeedSequence, SFC64, default_rng ) -from numpy.random.common import interface +from numpy.random._common import interface try: import cffi # noqa: F401 @@ -26,6 +27,12 @@ try: except ImportError: MISSING_CTYPES = False +if sys.flags.optimize > 1: + # no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1 + # cffi cannot succeed + MISSING_CFFI = True + + pwd = os.path.dirname(os.path.abspath(__file__)) @@ -138,7 +145,7 @@ def test_seedsequence(): assert len(dummy.spawn(10)) == 10 -class Base(object): +class Base: dtype = np.uint64 data2 = data1 = {} @@ -403,7 +410,7 @@ class TestSFC64(Base): cls.invalid_init_values = [(-1,)] -class TestDefaultRNG(object): +class TestDefaultRNG: def test_seed(self): for args in [(), (None,), (1234,), ([1234, 5678],)]: rg = default_rng(*args) |