diff options
author | Sam James <sam@gentoo.org> | 2022-11-11 08:18:25 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-06-06 03:10:43 +0200 |
commit | 86ff4f5c5d33795f6efc2c14177609c0caa431cd (patch) | |
tree | c0f50991e4602688836c4d0435e7892955c4d0b2 | |
parent | Skip sched/priority tests (diff) | |
download | cpython-86ff4f5c5d33795f6efc2c14177609c0caa431cd.tar.gz cpython-86ff4f5c5d33795f6efc2c14177609c0caa431cd.tar.bz2 cpython-86ff4f5c5d33795f6efc2c14177609c0caa431cd.zip |
Skip tests which interact with invalid UTF-8 files
These tests fail on filesystems which disallow
non-UTF8, like ZFS with 'utf8only' on.
Bug: https://bugs.python.org/issue37584
Bug: https://github.com/python/cpython/issues/81765
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | Lib/test/test_cmd_line_script.py | 1 | ||||
-rw-r--r-- | Lib/test/test_genericpath.py | 1 | ||||
-rw-r--r-- | Lib/test/test_httpservers.py | 1 | ||||
-rw-r--r-- | Lib/test/test_import/__init__.py | 1 | ||||
-rw-r--r-- | Lib/test/test_os.py | 4 | ||||
-rw-r--r-- | Lib/test/test_sqlite3/test_dbapi.py | 2 | ||||
-rw-r--r-- | Lib/test/test_unicode_file.py | 2 | ||||
-rw-r--r-- | Lib/test/test_unicode_file_functions.py | 1 | ||||
-rw-r--r-- | Lib/test/test_zipimport.py | 1 |
9 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 3a5a8abf81e..7c0f9c1a056 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -555,6 +555,7 @@ class CmdLineTest(unittest.TestCase): self.assertTrue(text[1].startswith(' File ')) self.assertTrue(text[3].startswith('NameError')) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_non_ascii(self): # Apple platforms deny the creation of a file with an invalid UTF-8 name. # Windows allows creating a name with an arbitrary bytes name, but diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index bf04b3fecf7..920aa6c1b8a 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -490,6 +490,7 @@ class CommonTest(GenericTest): for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'): self.assertIsInstance(abspath(path), str) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_nonascii_abspath(self): if ( os_helper.TESTFN_UNDECODABLE diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 1c370dcafa9..054a92e96cb 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -411,6 +411,7 @@ class SimpleHTTPServerTestCase(BaseTestCase): reader.close() return body + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(is_apple, 'undecodable name cannot always be decoded on Apple platforms') @unittest.skipIf(sys.platform == 'win32', diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index b09065f812c..2bae1655dfe 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -1816,6 +1816,7 @@ class ImportTracebackTests(unittest.TestCase): else: importlib.SourceLoader.exec_module = old_exec_module + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipUnless(TESTFN_UNENCODABLE, 'need TESTFN_UNENCODABLE') def test_unencodable_filename(self): # Issue #11619: The Python parser and the import machinery must not diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index de5a86f676c..5444b696c03 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2597,6 +2597,7 @@ class Pep383Tests(unittest.TestCase): def tearDown(self): shutil.rmtree(self.dir) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_listdir(self): expected = self.unicodefn found = set(os.listdir(self.dir)) @@ -2611,11 +2612,13 @@ class Pep383Tests(unittest.TestCase): finally: os.chdir(current_directory) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_open(self): for fn in self.unicodefn: f = open(os.path.join(self.dir, fn), 'rb') f.close() + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipUnless(hasattr(os, 'statvfs'), "need os.statvfs()") def test_statvfs(self): @@ -2625,6 +2628,7 @@ class Pep383Tests(unittest.TestCase): fullname = os.path.join(self.dir, fn) os.statvfs(fullname) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_stat(self): for fn in self.unicodefn: os.stat(os.path.join(self.dir, fn)) diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 51ce095df41..90ca1b7691f 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -671,6 +671,7 @@ class OpenTests(unittest.TestCase): self.assertTrue(os.path.exists(path)) cx.execute(self._sql) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(sys.platform == "win32", "skipped on Windows") @unittest.skipIf(is_apple, "skipped on Apple platforms") @unittest.skipIf(is_emscripten or is_wasi, "not supported on Emscripten/WASI") @@ -717,6 +718,7 @@ class OpenTests(unittest.TestCase): with self.assertRaises(sqlite.OperationalError): cx.execute(self._sql) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(sys.platform == "win32", "skipped on Windows") @unittest.skipIf(is_apple, "skipped on Apple platforms") @unittest.skipIf(is_emscripten or is_wasi, "not supported on Emscripten/WASI") diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index fe25bfe9f88..cf81c329c7c 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -119,11 +119,13 @@ class TestUnicodeFiles(unittest.TestCase): # The 'test' functions are unittest entry points, and simply call our # _test functions with each of the filename combinations we wish to test + @unittest.skipIf(TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_single_files(self): self._test_single(TESTFN_UNICODE) if TESTFN_UNENCODABLE is not None: self._test_single(TESTFN_UNENCODABLE) + @unittest.skipIf(TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_directories(self): # For all 'equivalent' combinations: # Make dir with encoded, chdir with unicode, checkdir with encoded diff --git a/Lib/test/test_unicode_file_functions.py b/Lib/test/test_unicode_file_functions.py index 25c16e3a0b7..55542259869 100644 --- a/Lib/test/test_unicode_file_functions.py +++ b/Lib/test/test_unicode_file_functions.py @@ -119,6 +119,7 @@ class UnicodeFileTests(unittest.TestCase): os.stat(name) self._apply_failure(os.listdir, name, self._listdir_failure) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') # Skip the test on Apple platforms, because they don't normalize the filename to # NFD (a variant of Unicode NFD form). Normalize the filename to NFC, NFKC, # NFKD in Python is useless, because darwin will normalize it later and so diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index e9c3218d2bb..e653e8de343 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -766,6 +766,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase): files = {TESTMOD + ".py": (NOW, raise_src)} self.doTest(None, files, TESTMOD, call=self.doTraceback) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(os_helper.TESTFN_UNENCODABLE is None, "need an unencodable filename") def testUnencodable(self): |