Skip to content

Remove SharedItems from test_excel #26579

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 15 commits into from
Jun 5, 2019
11 changes: 11 additions & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pytz import FixedOffset, utc

import pandas.util._test_decorators as td
import pandas.util.testing as tm

import pandas as pd

Expand Down Expand Up @@ -682,3 +683,13 @@ def tick_classes(request):
normalize=st.booleans(),
startingMonth=st.integers(min_value=1, max_value=12)
))


@pytest.fixture
def seriesd():
return tm.getSeriesData()


@pytest.fixture
def tdf():
return tm.makeTimeDataFrame()
7 changes: 3 additions & 4 deletions pandas/tests/frame/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import pandas as pd
import pandas.util.testing as tm

_seriesd = tm.getSeriesData()
_tsd = tm.getTimeSeriesData()

_frame = pd.DataFrame(_seriesd)
_frame2 = pd.DataFrame(_seriesd, columns=['D', 'C', 'B', 'A'])
_intframe = pd.DataFrame({k: v.astype(int) for k, v in _seriesd.items()})
_frame = pd.DataFrame(seriesd)
_frame2 = pd.DataFrame(seriesd, columns=['D', 'C', 'B', 'A'])
_intframe = pd.DataFrame({k: v.astype(int) for k, v in seriesd.items()})

_tsframe = pd.DataFrame(_tsd)

Expand Down
28 changes: 14 additions & 14 deletions pandas/tests/frame/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@


@pytest.fixture
def float_frame():
def float_frame(seriesd):
"""
Fixture for DataFrame of floats with index of unique strings

Columns are ['A', 'B', 'C', 'D'].
"""
return DataFrame(tm.getSeriesData())
return DataFrame(seriesd)


@pytest.fixture
def float_frame_with_na():
def float_frame_with_na(seriesd):
"""
Fixture for DataFrame of floats with index of unique strings

Columns are ['A', 'B', 'C', 'D']; some entries are missing
"""
df = DataFrame(tm.getSeriesData())
df = DataFrame(seriesd)
# set some NAs
df.loc[5:10] = np.nan
df.loc[15:20, -2:] = np.nan
return df


@pytest.fixture
def bool_frame_with_na():
def bool_frame_with_na(seriesd):
"""
Fixture for DataFrame of booleans with index of unique strings

Columns are ['A', 'B', 'C', 'D']; some entries are missing
"""
df = DataFrame(tm.getSeriesData()) > 0
df = DataFrame(seriesd) > 0
df = df.astype(object)
# set some NAs
df.loc[5:10] = np.nan
Expand All @@ -45,13 +45,13 @@ def bool_frame_with_na():


@pytest.fixture
def int_frame():
def int_frame(seriesd):
"""
Fixture for DataFrame of ints with index of unique strings

Columns are ['A', 'B', 'C', 'D']
"""
df = DataFrame({k: v.astype(int) for k, v in tm.getSeriesData().items()})
df = DataFrame({k: v.astype(int) for k, v in seriesd.items()})
# force these all to int64 to avoid platform testing issues
return DataFrame({c: s for c, s in df.items()}, dtype=np.int64)

Expand All @@ -67,25 +67,25 @@ def datetime_frame():


@pytest.fixture
def float_string_frame():
def float_string_frame(seriesd):
"""
Fixture for DataFrame of floats and strings with index of unique strings

Columns are ['A', 'B', 'C', 'D', 'foo'].
"""
df = DataFrame(tm.getSeriesData())
df = DataFrame(seriesd)
df['foo'] = 'bar'
return df


@pytest.fixture
def mixed_float_frame():
def mixed_float_frame(seriesd):
"""
Fixture for DataFrame of different float types with index of unique strings

Columns are ['A', 'B', 'C', 'D'].
"""
df = DataFrame(tm.getSeriesData())
df = DataFrame(seriesd)
df.A = df.A.astype('float32')
df.B = df.B.astype('float32')
df.C = df.C.astype('float16')
Expand All @@ -94,13 +94,13 @@ def mixed_float_frame():


@pytest.fixture
def mixed_int_frame():
def mixed_int_frame(seriesd):
"""
Fixture for DataFrame of different int types with index of unique strings

Columns are ['A', 'B', 'C', 'D'].
"""
df = DataFrame({k: v.astype(int) for k, v in tm.getSeriesData().items()})
df = DataFrame({k: v.astype(int) for k, v in seriesd.items()})
df.A = df.A.astype('int32')
df.B = np.ones(len(df.B), dtype='uint64')
df.C = df.C.astype('uint8')
Expand Down
5 changes: 0 additions & 5 deletions pandas/tests/groupby/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ def ts():
return tm.makeTimeSeries()


@pytest.fixture
def seriesd():
return tm.getSeriesData()


@pytest.fixture
def tsd():
return tm.getTimeSeriesData()
Expand Down
Loading