Skip to content

TST/CLN: use float_frame fixture to remove use of tm.getSeriesData() #26787

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 1 commit into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pandas/tests/arithmetic/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,9 @@ def test_datetime64_with_index(self):
tm.assert_series_equal(df['result'], df['expected'], check_names=False)

# TODO: taken from tests.frame.test_operators, needs cleanup
def test_frame_operators(self):
seriesd = tm.getSeriesData()
frame = pd.DataFrame(seriesd)
frame2 = pd.DataFrame(seriesd, columns=['D', 'C', 'B', 'A'])
def test_frame_operators(self, float_frame):
frame = float_frame
frame2 = pd.DataFrame(float_frame, columns=['D', 'C', 'B', 'A'])

garbage = np.random.random(4)
colSeries = pd.Series(garbage, index=np.array(frame.columns))
Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/frame/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ def test_neg_raises(self, df):
with pytest.raises(TypeError):
(- df['a'])

def test_invert(self):
_seriesd = tm.getSeriesData()
df = pd.DataFrame(_seriesd)
def test_invert(self, float_frame):
df = float_frame

assert_frame_equal(-(df < 0), ~(df < 0))

Expand Down
10 changes: 0 additions & 10 deletions pandas/tests/groupby/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,11 @@ def ts():
return tm.makeTimeSeries()


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


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


@pytest.fixture
def frame(seriesd):
return DataFrame(seriesd)


@pytest.fixture
def tsframe(tsd):
return DataFrame(tsd)
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,12 +1306,12 @@ def test_skip_group_keys():
assert_series_equal(result, expected)


def test_no_nonsense_name(frame):
def test_no_nonsense_name(float_frame):
# GH #995
s = frame['C'].copy()
s = float_frame['C'].copy()
s.name = None

result = s.groupby(frame['A']).agg(np.sum)
result = s.groupby(float_frame['A']).agg(np.sum)
assert result.name is None


Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexing/test_ix.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def test_ix_weird_slicing(self):
4: 5}})
tm.assert_frame_equal(df, expected)

def test_ix_assign_column_mixed(self):
def test_ix_assign_column_mixed(self, float_frame):
# GH #1142
df = DataFrame(tm.getSeriesData())
df = float_frame
df['foo'] = 'bar'

orig = df.loc[:, 'B'].copy()
Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/io/formats/test_to_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,8 @@ def test_to_html_with_no_bold():
assert '<strong' not in result


def test_to_html_columns_arg():
df = DataFrame(tm.getSeriesData())
result = df.to_html(columns=['A'])
def test_to_html_columns_arg(float_frame):
result = float_frame.to_html(columns=['A'])
assert '<th>B</th>' not in result


Expand Down