aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Pierre <benoit.pierre@gmail.com>2017-06-15 09:45:36 +0200
committerBenoit Pierre <benoit.pierre@gmail.com>2017-07-13 21:16:35 +0200
commite992c1ae2eba0638f5d463da78acf476ec2c04f8 (patch)
tree51a7d44a294a2f3c9ff588dd77d98b3100623fc7
parentaa43b11bff2450296da9c41e705d03b5c28bf5bf (diff)
downloadexternal_python_setuptools-e992c1ae2eba0638f5d463da78acf476ec2c04f8.tar.gz
external_python_setuptools-e992c1ae2eba0638f5d463da78acf476ec2c04f8.tar.bz2
external_python_setuptools-e992c1ae2eba0638f5d463da78acf476ec2c04f8.zip
tests: fix `fail_on_ascii` fixture
In my environment, with: - LANGUAGE=en_US:en_GB:en:C - LC_ALL=en_US.UTF-8 Running the testsuite with: - python3.6 -m pytest: is successful - tox -e py36: fails The later because LC_ALL is unset by tox, and LANGUAGE is not passed through, so `locale.getpreferredencoding()` returns 'ANSI_X3.4-1968'.
-rw-r--r--setuptools/tests/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py
index dbf16201..8ae4402d 100644
--- a/setuptools/tests/__init__.py
+++ b/setuptools/tests/__init__.py
@@ -1,4 +1,5 @@
"""Tests for the 'setuptools' package"""
+import locale
import sys
import os
import distutils.core
@@ -16,8 +17,7 @@ import setuptools.depends as dep
from setuptools import Feature
from setuptools.depends import Require
-c_type = os.environ.get("LC_CTYPE", os.environ.get("LC_ALL"))
-is_ascii = c_type in ("C", "POSIX")
+is_ascii = locale.getpreferredencoding() == 'ANSI_X3.4-1968'
fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale")