def test_auth_error_handling(contact_sync, default_account, db):
 default_account.refresh_token = 'foo'
 for auth_creds in default_account.auth_credentials:
  auth_creds.refresh_token = 'foo'
 db.session.commit()
 contact_sync.start()
 contact_sync.join(timeout=10)
 success = contact_sync.successful()
 if (not success):
  contact_sync.kill()
 assert success, "contact sync greenlet didn't terminate."

def test_auth_error_handling ( contact_sync , default_account , db ) : default_account . refresh_token = 'foo' for auth_creds in default_account . auth_credentials : auth_creds . refresh_token = 'foo' db . session . commit ( ) contact_sync . start ( ) contact_sync . join ( timeout = 10 ) success = contact_sync . successful ( ) if ( not success ) : contact_sync . kill ( ) assert success , "contact sync greenlet didn't terminate."
test that the contact sync greenlet stops if account credentials are invalid .