conftest.py 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import numpy as np
  2. import pytest
  3. from pandas import (
  4. Series,
  5. array,
  6. )
  7. @pytest.fixture(params=[None, False])
  8. def sort(request):
  9. """
  10. Valid values for the 'sort' parameter used in the Index
  11. setops methods (intersection, union, etc.)
  12. Caution:
  13. Don't confuse this one with the "sort" fixture used
  14. for DataFrame.append or concat. That one has
  15. parameters [True, False].
  16. We can't combine them as sort=True is not permitted
  17. in the Index setops methods.
  18. """
  19. return request.param
  20. @pytest.fixture(params=["D", "3D", "-3D", "h", "2h", "-2h", "min", "2min", "s", "-3s"])
  21. def freq_sample(request):
  22. """
  23. Valid values for 'freq' parameter used to create date_range and
  24. timedelta_range..
  25. """
  26. return request.param
  27. @pytest.fixture(params=[list, tuple, np.array, array, Series])
  28. def listlike_box(request):
  29. """
  30. Types that may be passed as the indexer to searchsorted.
  31. """
  32. return request.param