Skip to content

Use an explicit generic timezone in instance() tests - #1072

Open
Muguett-DBY wants to merge 1 commit into
python-pendulum:masterfrom
Muguett-DBY:test/generic-tzinfo-dateutil3
Open

Muguett-DBY wants to merge 1 commit into
python-pendulum:masterfrom
Muguett-DBY:test/generic-tzinfo-dateutil3

Conversation

@Muguett-DBY

Copy link
Copy Markdown

test_instance_with_aware_datetime_any_tzinfo fails with python-dateutil 3.0.0 on unchanged master: tz.gettz("Europe/Paris") now supplies an IANA key, so pendulum.instance() preserves Europe/Paris. The test still expects the generic fallback's +02:00 name.

Use an explicit tz.tzoffset("custom", 7200) fixture, which has neither key nor localize. This keeps the test exercising conversion of a generic tzinfo to a fixed offset. The adjacent ZoneInfo test already covers preserving an IANA name. Runtime code and dependency constraints are unchanged.

Verified on Windows and Linux, Python 3.12 (validation run):

  • The original test fails on unchanged master in both pure-Python and Rust-extension modes with dateutil 3.0.0.
  • With this one-line change, the full suite passes in both modes with dateutil 2.9.0.post0 and 3.0.0. Benchmark timing is disabled; benchmark test bodies still run.
  • The existing +02:00 assertion is retained.

Pull Request Check List

  • Added tests for changed code. Updated the existing test's fixture; no runtime change.
  • Updated documentation for changed code. Not applicable to a test-only correction.

AI-assisted with Codex. Reproduced while independently reviewing #1059; the same unrelated failure is noted in #1069.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant