Skip to content

Commit 87231e0

Browse files
committed
change conftest
1 parent 46830f4 commit 87231e0

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

protocol/tests/conftest.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
import pytest
22
import pandas as pd
3+
from pandas.api.exchange.implementation import _from_dataframe
34

45

5-
@pytest.fixture
6-
def constructor_frame(data):
7-
return pd.DataFrame(data)
6+
@pytest.fixture(scope="package")
7+
def df_from_dict():
8+
def maker(dct, is_categorical=False):
9+
df = pd.DataFrame(dct)
10+
return df.astype("category") if is_categorical else df
11+
12+
return maker
13+
14+
15+
@pytest.fixture(scope="package")
16+
def df_from_xchg():
17+
def maker(xchg):
18+
return _from_dataframe(xchg)
19+
20+
return maker

0 commit comments

Comments
 (0)