conftest.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import pytest
  2. @pytest.fixture(params=[True, False])
  3. def check_dtype(request):
  4. """
  5. Fixture returning `True` or `False`, determining whether to check
  6. if the `dtype` is identical or not, when comparing two data structures,
  7. e.g. `Series`, `SparseArray` or `DataFrame`.
  8. """
  9. return request.param
  10. @pytest.fixture(params=[True, False])
  11. def check_exact(request):
  12. """
  13. Fixture returning `True` or `False`, determining whether to
  14. compare floating point numbers exactly or not.
  15. """
  16. return request.param
  17. @pytest.fixture(params=[True, False])
  18. def check_index_type(request):
  19. """
  20. Fixture returning `True` or `False`, determining whether to check
  21. if the `Index` types are identical or not.
  22. """
  23. return request.param
  24. @pytest.fixture(params=[0.5e-3, 0.5e-5])
  25. def rtol(request):
  26. """
  27. Fixture returning 0.5e-3 or 0.5e-5. Those values are used as relative tolerance.
  28. """
  29. return request.param
  30. @pytest.fixture(params=[True, False])
  31. def check_categorical(request):
  32. """
  33. Fixture returning `True` or `False`, determining whether to
  34. compare internal `Categorical` exactly or not.
  35. """
  36. return request.param