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

Expect failure on macOS 10.13 and other operating systems where writing...

Expect failure on macOS 10.13 and other operating systems where writing latin-1 encoded filenames is prohibited. Fixes #1169.
parent 5e6d72b8
......@@ -80,6 +80,21 @@ def read_all_bytes(filename):
return fp.read()
def latin1_fail():
try:
desc, filename = tempfile.mkstemp(suffix=LATIN1_FILENAME)
os.close(desc)
os.remove(filename)
except Exception:
return True
fail_on_latin1_encoded_filenames = pytest.mark.xfail(
latin1_fail(),
reason="System does not support latin-1 filenames",
)
class TestSdistTest:
def setup_method(self, method):
self.temp_dir = tempfile.mkdtemp()
......@@ -290,6 +305,7 @@ class TestSdistTest:
assert filename in cmd.filelist.files
@py3_only
@fail_on_latin1_encoded_filenames
def test_read_manifest_skips_non_utf8_filenames(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
......@@ -321,6 +337,7 @@ class TestSdistTest:
assert filename not in cmd.filelist.files
@fail_on_ascii
@fail_on_latin1_encoded_filenames
def test_sdist_with_utf8_encoded_filename(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
......@@ -355,6 +372,7 @@ class TestSdistTest:
else:
assert filename in cmd.filelist.files
@fail_on_latin1_encoded_filenames
def test_sdist_with_latin1_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