Example #1
0
def test_dtype_univalent(any_numpy_dtype):
    dtype = PandasDtype(any_numpy_dtype)

    result = PandasDtype(dtype)
    assert result == dtype
Example #2
0
def test_constructor_from_string():
    result = PandasDtype.construct_from_string("int64")
    expected = PandasDtype(np.dtype("int64"))
    assert result == expected
Example #3
0
def test_repr():
    dtype = PandasDtype(np.dtype("int64"))
    assert repr(dtype) == "PandasDtype('int64')"
Example #4
0
def test_is_boolean(dtype, expected):
    dtype = PandasDtype(dtype)
    assert dtype._is_boolean is expected
Example #5
0
def test_is_numeric(dtype, expected):
    dtype = PandasDtype(dtype)
    assert dtype._is_numeric is expected
Example #6
0
def dtype(request):
    return PandasDtype(np.dtype(request.param))