Skip to content

Instantly share code, notes, and snippets.

@BryanCutler
Last active May 3, 2021 22:10
Show Gist options
  • Save BryanCutler/e5a2b268f92f6fb858a67163dff2fd11 to your computer and use it in GitHub Desktop.
Save BryanCutler/e5a2b268f92f6fb858a67163dff2fd11 to your computer and use it in GitHub Desktop.
Text Extensions for Pandas: Tips and Techniques for Extending Pandas, Part 1 Blog
@pytest.fixture
def dtype():
""" Return dtype of your extension array."""
return TensorDtype()
 
@pytest.fixture
def data(dtype):
""" Return an extension array as data for the tests."""
return pd.array(np.array([[i] for i in range(100)]), dtype=dtype)
# Include other fixtures required by base tests.
class TestPandasInterface(base.BaseInterfaceTests):
""" Extend the base Interface tests to run them all."""
pass
# Add more test classes as needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment