Port to non-MacOS platforms (#1026)
* Port to non-MacOS platforms * Keep NFD normalization on macOS * Update locale_util.py Fix lint error from ruff (runs in CI) * Update query.py click.Option first arg needs to be a list (different than click.option) * Dynamically normalize Unicode paths in test * Fix missing import --------- Co-authored-by: Rhet Turnbull <rturnbull@gmail.com>
This commit is contained in:
16
tests/locale_util.py
Normal file
16
tests/locale_util.py
Normal file
@@ -0,0 +1,16 @@
|
||||
""" Helpers for running locale-dependent tests """
|
||||
|
||||
import contextlib
|
||||
import locale
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def setlocale(typ, name):
|
||||
try:
|
||||
with contextlib.suppress(Exception):
|
||||
locale.setlocale(typ, name)
|
||||
# On Linux UTF-8 locales are separate
|
||||
locale.setlocale(typ, f"{name}.UTF-8")
|
||||
except locale.Error:
|
||||
pytest.skip(f"Locale {name} not available")
|
||||
Reference in New Issue
Block a user