Skip to content

Commit

Permalink
Merge pull request #336 from fizyk/osx/locale
Browse files Browse the repository at this point in the history
Set locale for osx testing env
  • Loading branch information
fizyk committed Oct 1, 2020
2 parents 1c96b88 + 7427378 commit 200b7ab
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit 200b7ab

Please sign in to comment.