mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-40280: Block more non-working syscalls in Emscripten (GH-31757)
- getgroups always fails. - geteuid and getegid always return 0 (root), which confuse tarfile and tests. - hardlinks (link, linkat) always fails. - non-encodable file names are not supported by NODERAWFS layer. - mark more tests with dependency on subprocess and multiprocessing. Mocking does not work if the module fails to import.
This commit is contained in:
parent
36dd7396fc
commit
5081e78efd
8 changed files with 37 additions and 10 deletions
|
@ -244,6 +244,7 @@ class CompileallTestsBase:
|
|||
self.assertFalse(pool_mock.called)
|
||||
self.assertTrue(compile_file_mock.called)
|
||||
|
||||
@skipUnless(_have_multiprocessing, "requires multiprocessing")
|
||||
@mock.patch('concurrent.futures.ProcessPoolExecutor', new=None)
|
||||
@mock.patch('compileall.compile_file')
|
||||
def test_compile_missing_multiprocessing(self, compile_file_mock):
|
||||
|
@ -296,6 +297,7 @@ class CompileallTestsBase:
|
|||
"""Recursive compile_dir ddir= contains package paths; bpo39769."""
|
||||
return self._test_ddir_only(ddir="<a prefix>", parallel=False)
|
||||
|
||||
@skipUnless(_have_multiprocessing, "requires multiprocessing")
|
||||
def test_ddir_multiple_workers(self):
|
||||
"""Recursive compile_dir ddir= contains package paths; bpo39769."""
|
||||
return self._test_ddir_only(ddir="<a prefix>", parallel=True)
|
||||
|
@ -304,6 +306,7 @@ class CompileallTestsBase:
|
|||
"""Recursive compile_dir ddir='' contains package paths; bpo39769."""
|
||||
return self._test_ddir_only(ddir="", parallel=False)
|
||||
|
||||
@skipUnless(_have_multiprocessing, "requires multiprocessing")
|
||||
def test_ddir_empty_multiple_workers(self):
|
||||
"""Recursive compile_dir ddir='' contains package paths; bpo39769."""
|
||||
return self._test_ddir_only(ddir="", parallel=True)
|
||||
|
@ -924,6 +927,7 @@ class CommandLineTestsNoSourceEpoch(CommandLineTestsBase,
|
|||
|
||||
|
||||
|
||||
@unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
|
||||
class HardlinkDedupTestsBase:
|
||||
# Test hardlink_dupes parameter of compileall.compile_dir()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue