80 lines
1.6 KiB
Python
80 lines
1.6 KiB
Python
|
import operator
|
||
|
|
||
|
import pytest
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def dtype():
|
||
|
"""A fixture providing the ExtensionDtype to validate."""
|
||
|
raise NotImplementedError
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data():
|
||
|
"""Length-100 array for this type."""
|
||
|
raise NotImplementedError
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data_missing():
|
||
|
"""Length-2 array with [NA, Valid]"""
|
||
|
raise NotImplementedError
|
||
|
|
||
|
|
||
|
@pytest.fixture(params=['data', 'data_missing'])
|
||
|
def all_data(request, data, data_missing):
|
||
|
"""Parametrized fixture giving 'data' and 'data_missing'"""
|
||
|
if request.param == 'data':
|
||
|
return data
|
||
|
elif request.param == 'data_missing':
|
||
|
return data_missing
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data_for_sorting():
|
||
|
"""Length-3 array with a known sort order.
|
||
|
|
||
|
This should be three items [B, C, A] with
|
||
|
A < B < C
|
||
|
"""
|
||
|
raise NotImplementedError
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data_missing_for_sorting():
|
||
|
"""Length-3 array with a known sort order.
|
||
|
|
||
|
This should be three items [B, NA, A] with
|
||
|
A < B and NA missing.
|
||
|
"""
|
||
|
raise NotImplementedError
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def na_cmp():
|
||
|
"""Binary operator for comparing NA values.
|
||
|
|
||
|
Should return a function of two arguments that returns
|
||
|
True if both arguments are (scalar) NA for your type.
|
||
|
|
||
|
By default, uses ``operator.is_``
|
||
|
"""
|
||
|
return operator.is_
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def na_value():
|
||
|
"""The scalar missing value for this type. Default 'None'"""
|
||
|
return None
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data_for_grouping():
|
||
|
"""Data for factorization, grouping, and unique tests.
|
||
|
|
||
|
Expected to be like [B, B, NA, NA, A, A, B, C]
|
||
|
|
||
|
Where A < B < C and NA is missing
|
||
|
"""
|
||
|
raise NotImplementedError
|