mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Issue #18571: Merge duplicate test code
Merge test/subprocessdata/inherited.py into test/subprocessdata/fd_status.py
This commit is contained in:
parent
8913a6c83d
commit
f6fa22efe0
3 changed files with 18 additions and 31 deletions
|
@ -1926,7 +1926,7 @@ class POSIXProcessTestCase(BaseTestCase):
|
|||
self.assertIn('overriding close_fds', str(context.warning))
|
||||
|
||||
def test_pass_fds_inheritable(self):
|
||||
script = support.findfile("inherited.py", subdir="subprocessdata")
|
||||
script = support.findfile("fd_status.py", subdir="subprocessdata")
|
||||
|
||||
inheritable, non_inheritable = os.pipe()
|
||||
self.addCleanup(os.close, inheritable)
|
||||
|
@ -1945,7 +1945,7 @@ class POSIXProcessTestCase(BaseTestCase):
|
|||
|
||||
# the inheritable file descriptor must be inherited, so its inheritable
|
||||
# flag must be set in the child process after fork() and before exec()
|
||||
self.assertEqual(fds, set(pass_fds))
|
||||
self.assertEqual(fds, set(pass_fds), "output=%a" % output)
|
||||
|
||||
# inheritable flag must not be changed in the parent process
|
||||
self.assertEqual(os.get_inheritable(inheritable), True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue