Commit Graph
3 Commits
Author SHA1 Message Date
Khem Raj e8ff0094d6 python3-time-machine: load pytester plugin for testdir fixture in ptest
test_marker_function/_and_fixture/_class/_module use the "testdir"
fixture, provided by pytest builtin pytester plugin. That plugin is
not autoloaded; upstream pyproject.toml sets addopts = "-p pytester"
but that file is not shipped into the ptest tree, so the fixture is
unavailable and these 4 tests error out (fixture testdir not found).
Pass -p pytester directly in run-ptest.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-08-29 21:43:06 -07:00
Khem Raj 765f779e87 python3-time-machine: fix ptest tzdata/dateutil issues
time_machine's C-level time/timezone patching relies on libc's
tzset()//usr/share/zoneinfo, which requires the system tzdata package -
distinct from python3-tzdata (Python's importlib zoneinfo data), which
the recipe already had. Add tzdata to RDEPENDS:${PN}-ptest.

Deselect test_destination_datetime_tzinfo_non_zoneinfo:  it builds an
aware datetime from dateutil's tz.gettz("America/Chicago") and expects
the CST (-6h) offset at the 1970 epoch. OE builds /usr/share/zoneinfo
in "slim" format (zic -b slim); dateutil's tzfile parser mishandles
the pre-first-transition instant of a slim tzfile and returns a 0
(UTC) offset there, so the epoch maps to 0 instead of 21600. Python's
own zoneinfo reads the same file correctly, so this is a
dateutil/slim-tzdata limitation, not a time_machine bug.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-08-29 21:43:06 -07:00
Tim Orling 8dd259ff4d python3-time-machine: add at v3.2.0
Travel through time in your tests.

https://time-machine.readthedocs.io/en/latest/

Dependency for python3-pendulum ptests.
Based on the recipe in meta-homeassistant.
Enable ptests.
Use git fetcher so that we have tests/ for ptest.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-02-06 10:06:19 -08:00