dst() is inferred from the standard time around each DST period.
(transitions, expected)
| 2770 | |
| 2771 | @pytest.mark.parametrize("transitions, expected", _dst_inference_cases()) |
| 2772 | def test_dst_inference(transitions, expected): |
| 2773 | """dst() is inferred from the standard time around each DST period.""" |
| 2774 | zone = tz.tzfile(construct_zone(transitions)) |
| 2775 | |
| 2776 | for dt_utc, dst in expected: |
| 2777 | dt = dt_utc.replace(tzinfo=tz.UTC).astimezone(zone) |
| 2778 | assert dt.dst() == dst, dt_utc |
| 2779 | assert dt.replace(tzinfo=None).replace(tzinfo=zone).dst() == dst |
| 2780 | |
| 2781 | # The pickled data is the data from the file, so the inference gives the |
| 2782 | # same answers after a round trip |
| 2783 | assert pickle.loads(pickle.dumps(zone)) == zone |
| 2784 | |
| 2785 | |
| 2786 | #### |
nothing calls this directly
no test coverage detected