mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-129158: Ensure we restore unix_events.can_use_pidfd after SubprocessThreadedWatcherTests finishes (#129160)
This commit is contained in:
parent
9012fa741d
commit
a9f5edbf5f
1 changed files with 5 additions and 0 deletions
|
@ -901,9 +901,14 @@ if sys.platform != 'win32':
|
|||
class SubprocessThreadedWatcherTests(SubprocessWatcherMixin,
|
||||
test_utils.TestCase):
|
||||
def setUp(self):
|
||||
self._original_can_use_pidfd = unix_events.can_use_pidfd
|
||||
# Force the use of the threaded child watcher
|
||||
unix_events.can_use_pidfd = mock.Mock(return_value=False)
|
||||
super().setUp()
|
||||
|
||||
def tearDown(self):
|
||||
unix_events.can_use_pidfd = self._original_can_use_pidfd
|
||||
return super().tearDown()
|
||||
|
||||
@unittest.skipUnless(
|
||||
unix_events.can_use_pidfd(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue