* 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>
17 lines
391 B
Python
17 lines
391 B
Python
""" 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")
|