Repository navigation
TST: Follow up #10677 (locale check in the month_plot test) - #10690
Merged
bashtage merged 1 commit intoNov 5, 2026
Merged
Conversation
month_plot and the expected labels of test_plot_month_locale both come from
strftime("%b") of the same locale, so the test also passes when the locale is
not applied and the labels stay English. Compare the three months with the
same name in every variant of the German locale (May, October and December;
March is "Mär" with glibc and "Mrz" on Windows) literally, and write the
expected list on one line as ruff format does.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #10677. That PR made
test_plot_month_localerun under the C locale and underde_DE.UTF-8and compare the labels ofmonth_plotwithstrftime("%b"). Its review left one item.NumPy's guide.
Changes
TST:month_plottakes the labels fromcalendar.month_abbr, which isstrftime('%b')of the same locale, so the comparison withstrftime("%b")cannot differ, and the test also passes when the locale was not applied and the labels stay English. The test now also compares May, October and December literally (May,Oct,Decunder C andMai,Okt,Dezunder German; March stays out because it is "Mär" with glibc and "Mrz" on Windows). The expected list is on one line asruff formatwrites it.Tests
calendar.different_locale(locale_name)bycalendar.different_locale("C")in a copy). The test of TST: use locale-formatted month_plot expectations #10677 as merged passes, and the test of this PR fails (ACTUAL: 'May',DESIRED: 'Mai').de_DE.UTF-8locale compiled withlocaledefinto a scratch directory in WSL:Mär,Mai,Okt,Dez) and of Windows (Python 3.14,Mrz,Mai,Okt,Dez). I did not run macOS; the macOS jobs of Azure run the German case (the step of TST: use locale-formatted month_plot expectations #10677 requires the locale there).test_tsaplots.py: 46 passed with the German locale available. Without it (the WSL default) the German case is xfailed, as on a Linux job withoutde_DE.UTF-8, and the C case passes.ruff checkpasses. The file is notruff formatclean elsewhere (thezipoftest_plot_quarter); I left that line alone.AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): Claude Code (Claude Sonnet 5.5).
Used for: reviewing TST: use locale-formatted month_plot expectations #10677, and writing the test change.
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
🤖 Generated with Claude Code