Skip to content

fix: skip French locale test when locale unavailable (#1213) - #1219

Merged
vspinu merged 1 commit into
tidyverse:mainfrom
LeonidasZhak:fix/skip-french-locale-test-1213
Jun 15, 2026
Merged

vspinu merged 1 commit into
tidyverse:mainfrom
LeonidasZhak:fix/skip-french-locale-test-1213

Conversation

@LeonidasZhak

Copy link
Copy Markdown
Contributor

Problem

Test "parsing months with dots works in French linux locale" (test-parsers.R:1121) errors on systems where fr_FR.utf8 is not installed:

Error in `Sys.setlocale("LC_TIME", locale)`: (converted from warning) OS reports request to set locale to "fr_FR.utf8" cannot be honored

Fix

Added skip_if guard and on.exit cleanup, matching the existing pattern in the adjacent test "parsing with r and R formats works in non-english locale" (line 1143):

suppressWarnings(testthat::skip_if(Sys.setlocale("LC_TIME", "fr_FR.utf8") == ""))
on.exit(Sys.setlocale("LC_TIME", "C"))

Testing

  • Ran testthat::test_file("tests/testthat/test-parsers.R") — all tests pass
  • On macOS: test skipped via skip_on_os("mac") (pre-existing)
  • On Linux without French locale: now gracefully skipped via skip_if (the fix)

Closes #1213

Add skip_if guard and on.exit cleanup to 'parsing months with dots works
in French linux locale' test, matching the existing pattern in the
'parsing with r and R formats works in non-english locale' test below it.

Without this, the test errors on systems where fr_FR.utf8 is not installed.
@vspinu
vspinu merged commit 73028bb into tidyverse:main Jun 15, 2026
9 checks passed
@vspinu

vspinu commented Jun 15, 2026

Copy link
Copy Markdown
Member

Thanks!

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.

Missing skip behaviour in test-parsers if French linux locale is unavailable

2 participants