Skip to content

Commit

Permalink
Merge 4d927b3 into 1c96b88
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Oct 1, 2020
2 parents 1c96b88 + 4d927b3 commit 1992e7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- virtualenv venv -p python3
- source venv/bin/activate
script:
- locale
- py.test -n 0
- stage: deploy
if: tag IS present
Expand Down
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 1992e7c

Please sign in to comment.