Repository navigation
Remove more pytz compat code + regression fixes - #1514
Conversation
|
Sorry for the various pings @akx I hope I'm not annoying you too much 😅 but I've apparently reached the 3 PR repo limit so I can only open this PR as a draft.. Any chance you can remove this rule for me? Thanks! ❤️ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1514 +/- ##
=======================================
Coverage 94.43% 94.43%
=======================================
Files 27 27
Lines 5051 5051
=======================================
Hits 4770 4770
Misses 281 281
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| return zoneinfo.ZoneInfo(zone) | ||
| except zoneinfo.ZoneInfoNotFoundError as e: | ||
| except (zoneinfo.ZoneInfoNotFoundError, ValueError) as e: | ||
| # ValueError is raised for invalid zone names (e.g. absolute paths) |
There was a problem hiding this comment.
I missed this in the other PR, I added a test for it.
| >>> from babel.dates import _localize | ||
|
|
||
| >>> dt = _localize(tz, datetime(2007, 8, 15)) | ||
| >>> dt = datetime(2007, 8, 15, tzinfo=tz) |
There was a problem hiding this comment.
_localize is now not used anywhere besides tests. Is it safe to move it there or do you think there's a chance someone is relying on it (despite being private)?
| reason="Issue 1092 is not applicable on Windows", | ||
| ) | ||
| def test_issue_1092(monkeypatch): | ||
| pytest.importorskip("pytz", reason="pytz is not installed") |
There was a problem hiding this comment.
This test does not need pytz
|
@tomasr8 not at all! Added you to the allowlist. |
|
Awesome, thanks! :) |
A couple more cleanups + a regression fix following #1472