@pytest.fixture
def fake_save_manager():
 fake_save_manager = unittest.mock.Mock(spec=savemanager.SaveManager)
 objreg.register('save-manager', fake_save_manager)
 (yield fake_save_manager)
 objreg.delete('save-manager')

@ pytest . fixture def fake_save_manager ( ) : fake_save_manager = unittest . mock . Mock ( spec = savemanager . SaveManager ) objreg . register ( 'save-manager' , fake_save_manager ) ( yield fake_save_manager ) objreg . delete ( 'save-manager' )
create a mock of save-manager and register it into objreg .