Commit e992c1ae authored by Benoit Pierre's avatar Benoit Pierre

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'.
parent aa43b11b
"""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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment