diff options
| author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-07 19:21:57 -0700 |
|---|---|---|
| committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-07 19:21:57 -0700 |
| commit | b1fb17ab7c4e6479bd4632a2407930019ca4877e (patch) | |
| tree | b1e7c6db061c7669fb5f8c9f882b403b2a73ac58 /numpy | |
| parent | 2382a1ba73b1969091b250fa364ae73158275f77 (diff) | |
| download | numpy-b1fb17ab7c4e6479bd4632a2407930019ca4877e.tar.gz | |
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") |
