@pytest.fixture
def download_stub(win_registry):
 stub = FakeDownloadManager()
 objreg.register('qtnetwork-download-manager', stub, scope='window', window='last-focused')
 (yield)
 objreg.delete('qtnetwork-download-manager', scope='window', window='last-focused')

@ pytest . fixture def download_stub ( win_registry ) : stub = FakeDownloadManager ( ) objreg . register ( 'qtnetwork-download-manager' , stub , scope = 'window' , window = 'last-focused' ) ( yield ) objreg . delete ( 'qtnetwork-download-manager' , scope = 'window' , window = 'last-focused' )
register a fakedownloadmanager .