test_resolution.py 567 B

1234567891011121314151617181920212223
  1. import pytest
  2. import pandas as pd
  3. class TestResolution:
  4. @pytest.mark.parametrize(
  5. "freq,expected",
  6. [
  7. ("A", "year"),
  8. ("Q", "quarter"),
  9. ("M", "month"),
  10. ("D", "day"),
  11. ("H", "hour"),
  12. ("T", "minute"),
  13. ("S", "second"),
  14. ("L", "millisecond"),
  15. ("U", "microsecond"),
  16. ],
  17. )
  18. def test_resolution(self, freq, expected):
  19. idx = pd.period_range(start="2013-04-01", periods=30, freq=freq)
  20. assert idx.resolution == expected