Skip to content

Commit a5ded69

Browse files
jbrockmendelJulianWgs
authored andcommitted
TST: use fixture (pandas-dev#37255)
1 parent 90fc665 commit a5ded69

File tree

3 files changed

+293
-224
lines changed

3 files changed

+293
-224
lines changed

pandas/conftest.py

+13
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,19 @@ def multiindex_year_month_day_dataframe_random_data():
361361
return ymd
362362

363363

364+
@pytest.fixture
365+
def multiindex_dataframe_random_data():
366+
"""DataFrame with 2 level MultiIndex with random data"""
367+
index = MultiIndex(
368+
levels=[["foo", "bar", "baz", "qux"], ["one", "two", "three"]],
369+
codes=[[0, 0, 0, 1, 1, 2, 2, 3, 3, 3], [0, 1, 2, 0, 1, 1, 2, 0, 1, 2]],
370+
names=["first", "second"],
371+
)
372+
return DataFrame(
373+
np.random.randn(10, 3), index=index, columns=Index(["A", "B", "C"], name="exp")
374+
)
375+
376+
364377
def _create_multiindex():
365378
"""
366379
MultiIndex used to test the general functionality of this object

pandas/tests/indexing/multiindex/conftest.py

-17
This file was deleted.

0 commit comments

Comments
 (0)