diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-10-08 16:02:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 16:02:51 -0500 |
commit | 4189ed73feecc0b1c6febf2e1ba6dbaa7bfb26dd (patch) | |
tree | 2ee8dfb4305a2545a1ea44440e91b8882c2826a0 /numpy | |
parent | 2f4bc6f1d561230e9e295ce0d49fef5c4deb7ea0 (diff) | |
parent | b1fb17ab7c4e6479bd4632a2407930019ca4877e (diff) | |
download | numpy-4189ed73feecc0b1c6febf2e1ba6dbaa7bfb26dd.tar.gz |
Merge pull request #12109 from tylerjereddy/test_issctype
TST: add unit test for issctype
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_numerictypes.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/numpy/core/tests/test_numerictypes.py b/numpy/core/tests/test_numerictypes.py index 70871774f..dd7f680a9 100644 --- a/numpy/core/tests/test_numerictypes.py +++ b/numpy/core/tests/test_numerictypes.py @@ -475,6 +475,18 @@ class Test_sctype2char(object): def test_non_type(self): assert_raises(ValueError, np.sctype2char, 1) +@pytest.mark.parametrize("rep, expected", [ + (np.int32, True), + (list, False), + (1.1, False), + (str, True), + ]) +def test_issctype(rep, expected): + # ensure proper identification of scalar + # data-types by issctype() + actual = np.issctype(rep) + assert_equal(actual, expected) + @pytest.mark.skipif(sys.flags.optimize > 1, reason="no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1") |