Skip to content

TST: Parametrized index tests #20624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 24, 2018
18 changes: 13 additions & 5 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

import numpy
import pandas
import numpy as np
import pandas as pd
import pandas.util._test_decorators as td


Expand Down Expand Up @@ -36,15 +36,15 @@ def pytest_runtest_setup(item):

@pytest.fixture(autouse=True)
def configure_tests():
pandas.set_option('chained_assignment', 'raise')
pd.set_option('chained_assignment', 'raise')


# For running doctests: make np and pd names available

@pytest.fixture(autouse=True)
def add_imports(doctest_namespace):
doctest_namespace['np'] = numpy
doctest_namespace['pd'] = pandas
doctest_namespace['np'] = np
doctest_namespace['pd'] = pd


@pytest.fixture(params=['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil'])
Expand Down Expand Up @@ -89,6 +89,14 @@ def join_type(request):
return request.param


@pytest.fixture(params=[None, np.nan, pd.NaT])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea. Some more for the list: np.timedelta64('NaT'), np.datetime64('NaT'), float('nan'), np.float('NaN').

Note that np.float('NaN') does not return np.nan (i.e. does not behave like pd.NaT), so this would catch any occurrences in pandas of e.g if foo is np.nan

def nulls_fixture(request):
"""
Fixture for each null type in pandas
"""
return request.param


TIMEZONES = [None, 'UTC', 'US/Eastern', 'Asia/Tokyo', 'dateutil/US/Pacific']


Expand Down
Loading