conftest.py 227 B

123456789101112
  1. import pytest
  2. import pandas as pd
  3. @pytest.fixture
  4. def df_from_dict():
  5. def maker(dct, is_categorical=False):
  6. df = pd.DataFrame(dct)
  7. return df.astype("category") if is_categorical else df
  8. return maker