Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set locale for osx testing env #336

Merged
merged 1 commit into from
Oct 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/pytest_postgresql/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""PostgreSQL executor crafter around pg_ctl."""

import os.path
import platform
import re
import shutil
import subprocess
Expand All @@ -29,6 +30,11 @@
from mirakuru.base import ExecutorType
from mirakuru.exceptions import ProcessFinishedWithError

_LOCALE = "C.UTF-8"

if platform.system() == "Darwin":
_LOCALE = "en_US.UTF-8"


class PostgreSQLUnsupported(Exception):
"""Exception raised when postgresql<9.0 would be detected."""
Expand Down Expand Up @@ -100,9 +106,9 @@ def __init__(self, executable, host, port,
timeout=timeout,
sleep=sleep,
envvars={
'LC_ALL': 'C.UTF-8',
'LC_CTYPE': 'C.UTF-8',
'LANG': 'C.UTF-8',
"LC_ALL": _LOCALE,
"LC_CTYPE": _LOCALE,
"LANG": _LOCALE,
}
)

Expand Down