Commit efededd6 authored by Jason R. Coombs's avatar Jason R. Coombs

Expect failures on these tests due to ASCII

parent 81c103f7
......@@ -16,6 +16,10 @@ 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")
fail_on_ascii = pytest.mark.xfail(is_ascii, "Test fails in this locale")
def makeSetup(**args):
"""Return distribution from 'setup(**args)', without executing commands"""
......
......@@ -35,7 +35,7 @@ import setuptools.tests.server
import pkg_resources
from .py26compat import tarfile_open
from . import contexts
from . import contexts, is_ascii
from .textwrap import DALS
......@@ -430,8 +430,6 @@ class TestScriptHeader:
expected = '#!"%s"\n' % self.exe_with_spaces
assert actual == expected
c_type = os.environ.get("LC_CTYPE", os.environ.get("LC_ALL"))
is_ascii = c_type in ("C", "POSIX")
@pytest.mark.xfail(
compat.PY3 and is_ascii,
reason="Test fails in this locale on Python 3"
......
......@@ -16,6 +16,8 @@ from setuptools.compat import StringIO, unicode, PY3, PY2
from setuptools.command.sdist import sdist
from setuptools.command.egg_info import manifest_maker
from setuptools.dist import Distribution
from setuptools.tests import fail_on_ascii
SETUP_ATTRS = {
'name': 'sdist_test',
......@@ -147,6 +149,7 @@ class TestSdistTest:
assert 'setup.py' not in manifest, manifest
assert 'setup.cfg' not in manifest, manifest
@fail_on_ascii
def test_manifest_is_written_with_utf8_encoding(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
......@@ -256,6 +259,7 @@ class TestSdistTest:
# The filelist should have been updated as well
assert u_filename not in mm.filelist.files
@fail_on_ascii
def test_manifest_is_read_with_utf8_encoding(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
......@@ -320,9 +324,7 @@ class TestSdistTest:
filename = filename.decode('latin-1')
assert filename not in cmd.filelist.files
@pytest.mark.skipif(PY3 and locale.getpreferredencoding() != 'UTF-8',
reason='Unittest fails if locale is not utf-8 but the manifests is '
'recorded correctly')
@fail_on_ascii
def test_sdist_with_utf8_encoded_filename(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
......
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