From a0e8e53cecc238e3bce2247308fe7dd94114ef35 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 13 Nov 2022 14:07:08 -0500 Subject: [PATCH] Skip an additional test under xdist. Ref pypa/distutils#183. Expanded workaround for pytest-dev/pytest-xdist#843. --- setuptools/tests/test_sdist.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index adf4325d61..30631c2429 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -89,6 +89,12 @@ def latin1_fail(): ) +skip_under_xdist = pytest.mark.skipif( + "os.environ.get('PYTEST_XDIST_WORKER')", + reason="pytest-dev/pytest-xdist#843", +) + + def touch(path): path.write_text('', encoding='utf-8') @@ -322,10 +328,7 @@ def test_write_manifest_allows_utf8_filenames(self): # The filelist should have been updated as well assert u_filename in mm.filelist.files - @pytest.mark.skipif( - "os.environ.get('PYTEST_XDIST_WORKER')", - reason="pytest-dev/pytest-xdist#843", - ) + @skip_under_xdist def test_write_manifest_skips_non_utf8_filenames(self): """ Files that cannot be encoded to UTF-8 (specifically, those that @@ -464,6 +467,7 @@ def make_strings(cls, item): return str(item) @fail_on_latin1_encoded_filenames + @skip_under_xdist def test_sdist_with_latin1_encoded_filename(self): # Test for #303. dist = Distribution(self.make_strings(SETUP_ATTRS))