diff --git a/tests/contrib/test__appengine_ndb.py b/tests/contrib/test__appengine_ndb.py index 30b4dc641..6bb1cde0d 100644 --- a/tests/contrib/test__appengine_ndb.py +++ b/tests/contrib/test__appengine_ndb.py @@ -166,7 +166,3 @@ def test__from_base_type_bad_json(self): creds_prop = TestNDBModel.creds creds_json = '{JK-I-AM-NOT-JSON' self.assertIsNone(creds_prop._from_base_type(creds_json)) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_appengine.py b/tests/contrib/test_appengine.py index 03beed5e8..de7821c30 100644 --- a/tests/contrib/test_appengine.py +++ b/tests/contrib/test_appengine.py @@ -1081,7 +1081,3 @@ def test_build_and_parse_state(self): appengine._parse_state_value(state, UserMock())) with self.assertRaises(appengine.InvalidXsrfTokenError): appengine._parse_state_value(state[1:], UserMock()) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_devshell.py b/tests/contrib/test_devshell.py index b9b2496fb..9fcafd4d0 100644 --- a/tests/contrib/test_devshell.py +++ b/tests/contrib/test_devshell.py @@ -270,7 +270,3 @@ def test_serialization_data(self): credentials = DevshellCredentials() with self.assertRaises(NotImplementedError): getattr(credentials, 'serialization_data') - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_dictionary_storage.py b/tests/contrib/test_dictionary_storage.py index 0cb975f76..b1cdb6d45 100644 --- a/tests/contrib/test_dictionary_storage.py +++ b/tests/contrib/test_dictionary_storage.py @@ -104,7 +104,3 @@ def test_delete(self): self.assertNotIn(key, dictionary) self.assertIsNone(storage.get()) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_django_orm.py b/tests/contrib/test_django_orm.py index 57a9d6bb9..2924bea1e 100644 --- a/tests/contrib/test_django_orm.py +++ b/tests/contrib/test_django_orm.py @@ -317,7 +317,3 @@ def __init__(self, set_store=False, *args, **kwargs): self.deleted = False credentials = CredentialsField() - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_flask_util.py b/tests/contrib/test_flask_util.py index c261d9708..f4fe0e924 100644 --- a/tests/contrib/test_flask_util.py +++ b/tests/contrib/test_flask_util.py @@ -528,7 +528,3 @@ def test_delete(self): self.oauth2.storage.delete() self.assertNotIn('google_oauth2_credentials', flask.session) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_gce.py b/tests/contrib/test_gce.py index cb65bd612..197402051 100644 --- a/tests/contrib/test_gce.py +++ b/tests/contrib/test_gce.py @@ -147,7 +147,3 @@ def test_save_to_well_known_file(self): save_to_well_known_file(credentials) finally: os.path.isdir = ORIGINAL_ISDIR - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_keyring_storage.py b/tests/contrib/test_keyring_storage.py index d30ea87dd..3ebf48b05 100644 --- a/tests/contrib/test_keyring_storage.py +++ b/tests/contrib/test_keyring_storage.py @@ -169,7 +169,3 @@ def acquire(self): def release(self): self._release_count += 1 - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_locked_file.py b/tests/contrib/test_locked_file.py index ecaf9ced5..384bef3f4 100644 --- a/tests/contrib/test_locked_file.py +++ b/tests/contrib/test_locked_file.py @@ -242,7 +242,3 @@ def test_unlock_and_close(self): instance, opener = self._make_one() instance.unlock_and_close() opener.unlock_and_close.assert_called_with() - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_multistore_file.py b/tests/contrib/test_multistore_file.py index dec28e21a..de54cb02b 100644 --- a/tests/contrib/test_multistore_file.py +++ b/tests/contrib/test_multistore_file.py @@ -381,7 +381,3 @@ def test__delete_credential_nonexistent(self): multistore._data = {} multistore._delete_credential('nonexistent_key') self.assertTrue(write_mock.called) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/contrib/test_xsrfutil.py b/tests/contrib/test_xsrfutil.py index 0f66edf2e..363a189eb 100644 --- a/tests/contrib/test_xsrfutil.py +++ b/tests/contrib/test_xsrfutil.py @@ -291,7 +291,3 @@ def testGenerateAndValidateToken(self): None, TEST_USER_ID_1, action_id=TEST_ACTION_ID_1)) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test__helpers.py b/tests/test__helpers.py index 581b32eeb..21a4af8a9 100644 --- a/tests/test__helpers.py +++ b/tests/test__helpers.py @@ -117,7 +117,3 @@ def test_bad_input(self): bad_string = b'+' with self.assertRaises((TypeError, binascii.Error)): _urlsafe_b64decode(bad_string) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test__pure_python_crypt.py b/tests/test__pure_python_crypt.py index c20a25c0a..754b29d7d 100644 --- a/tests/test__pure_python_crypt.py +++ b/tests/test__pure_python_crypt.py @@ -178,7 +178,3 @@ def test_from_string_bogus_key(self): key_bytes = 'bogus-key' with self.assertRaises(ValueError): RsaSigner.from_string(key_bytes) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test__pycrypto_crypt.py b/tests/test__pycrypto_crypt.py index d871e7ceb..99e968a7d 100644 --- a/tests/test__pycrypto_crypt.py +++ b/tests/test__pycrypto_crypt.py @@ -69,7 +69,3 @@ def test_from_string_bad_key(self): key_bytes = 'definitely-not-pem-format' with self.assertRaises(NotImplementedError): PyCryptoSigner.from_string(key_bytes) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_client.py b/tests/test_client.py index 805883511..8099538f6 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -2377,7 +2377,3 @@ def test_FromResponse_with_expires_in(self, utcnow): expected_result = DeviceFlowInfo(self.DEVICE_CODE, self.USER_CODE, None, self.VER_URL, expire) self.assertEqual(result, expected_result) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_clientsecrets.py b/tests/test_clientsecrets.py index 8d4833a73..5065e310d 100644 --- a/tests/test_clientsecrets.py +++ b/tests/test_clientsecrets.py @@ -279,7 +279,3 @@ def test_without_cache(self): client_type, client_info = clientsecrets.loadfile(VALID_FILE) self.assertEqual('web', client_type) self.assertEqual('foo_client_secret', client_info['client_secret']) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_crypt.py b/tests/test_crypt.py index d7dcc4fe3..55e60d954 100644 --- a/tests/test_crypt.py +++ b/tests/test_crypt.py @@ -310,7 +310,3 @@ def test_success(self, verify_sig, verify_time, check_aud): verify_time.assert_called_once_with(payload_dict) check_aud.assert_called_once_with(payload_dict, audience) certs.values.assert_called_once_with() - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_file.py b/tests/test_file.py index 344032762..27f3cab46 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -241,7 +241,3 @@ def test_access_token_credentials(self): if os.name == 'posix': # pragma: NO COVER mode = os.stat(FILENAME).st_mode self.assertEquals('0o600', oct(stat.S_IMODE(mode))) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_jwt.py b/tests/test_jwt.py index a9f19b740..f567f5d6a 100644 --- a/tests/test_jwt.py +++ b/tests/test_jwt.py @@ -331,7 +331,3 @@ class TestHasOpenSSLFlag(unittest2.TestCase): def test_true(self): self.assertEqual(True, HAS_OPENSSL) self.assertEqual(True, HAS_CRYPTO) - - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_service_account.py b/tests/test_service_account.py index 31d63b6c8..9c7f44408 100644 --- a/tests/test_service_account.py +++ b/tests/test_service_account.py @@ -581,6 +581,3 @@ def test_refresh(self, utcnow): token_2 = self.jwt.access_token self.assertEquals(self.jwt.token_expiry, T2_EXPIRY_DATE) self.assertNotEqual(token_1, token_2) - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main() diff --git a/tests/test_tools.py b/tests/test_tools.py index b5e07db82..8efe9e1c7 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -102,7 +102,7 @@ def test_run_flow_no_webserver_explicit_flags( self.assertEqual(self.flow.redirect_uri, OOB_CALLBACK_URN) self.flow.step2_exchange.assert_called_once_with( 'auth_code', http=None) - + @mock.patch('oauth2client.tools.logging') @mock.patch('oauth2client.tools.input') def test_run_flow_no_webserver_exchange_error( @@ -161,7 +161,7 @@ def test_run_flow_webserver_no_code( self, webbrowser_open_mock, server_ctor_mock, logging_mock): server_ctor_mock.return_value = self.server self.server.query_params = {} - + # No code found in response with self.assertRaises(SystemExit): returned_credentials = tools.run_flow( @@ -193,7 +193,3 @@ def test_run_flow_webserver_fallback( class TestMessageIfMissing(unittest2.TestCase): def test_message_if_missing(self): self.assertIn('somefile.txt', tools.message_if_missing('somefile.txt')) - - -if __name__ == '__main__': # pragma: NO COVER - unittest.main() diff --git a/tests/test_util.py b/tests/test_util.py index fcfa37138..9f1d7ed2d 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -124,6 +124,3 @@ def test__add_query_parameter(self): self.assertEqual( util._add_query_parameter('/action', 'a', ' ='), '/action?a=+%3D') - -if __name__ == '__main__': # pragma: NO COVER - unittest2.main()