Skip to content

Commit

Permalink
tests: skip if locale not available
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 5, 2024
1 parent b513be0 commit f7f15be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
allow-prereleases: true

- name: Add locale for locale test
if: runner.os == 'Linux'
if: runner.os == 'Linux' && matrix.python-version != '3.10'
run: sudo locale-gen fr_FR.UTF-8

- name: Setup uv (cached)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def french():
locale.setlocale(locale.LC_ALL, "fr_FR.utf-8")
reload_cli()
yield
except locale.Error:
pytest.skip(
"No fr_FR locale found, run 'sudo locale-gen fr_FR.UTF-8' to run this test"
)
finally:
locale.setlocale(locale.LC_ALL, "")
reload_cli()
Expand Down

0 comments on commit f7f15be

Please sign in to comment.