@@ -1713,29 +1713,29 @@ def create_policy(self):
17131713        return  asyncio .DefaultEventLoopPolicy ()
17141714
17151715    def  test_get_default_child_watcher (self ):
1716-         policy   =   self . create_policy () 
1717-         self . assertIsNone ( policy . _watcher ) 
1718-         unix_events . can_use_pidfd   =   mock . Mock ()
1719-         unix_events . can_use_pidfd . return_value   =   False 
1720-         with  self .assertWarns (DeprecationWarning ):
1721-             watcher  =  policy .get_child_watcher ()
1722-         self .assertIsInstance (watcher , asyncio .ThreadedChildWatcher )
1716+         with   mock . patch ( 'asyncio.unix_events.can_use_pidfd' , 
1717+                          return_value = False ): 
1718+              policy   =   self . create_policy ()
1719+              self . assertIsNone ( policy . _watcher ) 
1720+              with  self .assertWarns (DeprecationWarning ):
1721+                  watcher  =  policy .get_child_watcher ()
1722+              self .assertIsInstance (watcher , asyncio .ThreadedChildWatcher )
17231723
1724-         self .assertIs (policy ._watcher , watcher )
1725-         with  self .assertWarns (DeprecationWarning ):
1726-             self .assertIs (watcher , policy .get_child_watcher ())
1724+              self .assertIs (policy ._watcher , watcher )
1725+              with  self .assertWarns (DeprecationWarning ):
1726+                  self .assertIs (watcher , policy .get_child_watcher ())
17271727
1728-         policy   =   self . create_policy () 
1729-         self . assertIsNone ( policy . _watcher ) 
1730-         unix_events . can_use_pidfd   =   mock . Mock ()
1731-         unix_events . can_use_pidfd . return_value   =   True 
1732-         with  self .assertWarns (DeprecationWarning ):
1733-             watcher  =  policy .get_child_watcher ()
1734-         self .assertIsInstance (watcher , asyncio .PidfdChildWatcher )
1728+         with   mock . patch ( 'asyncio.unix_events.can_use_pidfd' , 
1729+                          return_value = True ): 
1730+              policy   =   self . create_policy ()
1731+              self . assertIsNone ( policy . _watcher ) 
1732+              with  self .assertWarns (DeprecationWarning ):
1733+                  watcher  =  policy .get_child_watcher ()
1734+              self .assertIsInstance (watcher , asyncio .PidfdChildWatcher )
17351735
1736-         self .assertIs (policy ._watcher , watcher )
1737-         with  self .assertWarns (DeprecationWarning ):
1738-             self .assertIs (watcher , policy .get_child_watcher ())
1736+              self .assertIs (policy ._watcher , watcher )
1737+              with  self .assertWarns (DeprecationWarning ):
1738+                  self .assertIs (watcher , policy .get_child_watcher ())
17391739
17401740    def  test_get_child_watcher_after_set (self ):
17411741        policy  =  self .create_policy ()
0 commit comments