Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #306 from dhermes/remove-unittest-main
Browse files Browse the repository at this point in the history
Added no-cover pragmas to unittest.main calls.
  • Loading branch information
nathanielmanistaatgoogle committed Sep 22, 2015
2 parents fb2997c + 9641c31 commit 3b6b4be
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 9 deletions.
4 changes: 4 additions & 0 deletions tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ def test_bad_input(self):
bad_string = b'+'
self.assertRaises((TypeError, binascii.Error),
_urlsafe_b64decode, bad_string)


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
4 changes: 4 additions & 0 deletions tests/test__pycrypto_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ def test_from_string_unicode_key(self):
public_key = public_key.decode('utf-8')
verifier = PyCryptoVerifier.from_string(public_key, is_x509_cert=True)
self.assertTrue(isinstance(verifier, PyCryptoVerifier))


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_appengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,5 +880,5 @@ def test_build_and_parse_state(self):
appengine._parse_state_value, state[1:], UserMock())


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1379,5 +1379,5 @@ def test_existing(self):
self._save_helper(filename)


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_clientsecrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,5 @@ def test_without_cache(self):
self.assertEqual('foo_client_secret', client_info['client_secret'])


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
4 changes: 4 additions & 0 deletions tests/test_crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,7 @@ 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
unittest.main()
4 changes: 4 additions & 0 deletions tests/test_devshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,7 @@ def test_serialization_data(self):
credentials = DevshellCredentials()
self.assertRaises(NotImplementedError, getattr,
credentials, 'serialization_data')


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_django_orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ def test_field_pickled(self):
self.assertEqual(prep_value, self.pickle)


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,5 +415,5 @@ def test_multistore_file_get_all_keys(self):
self.assertEquals([], keys)


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
3 changes: 2 additions & 1 deletion tests/test_flask_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,5 +426,6 @@ def test_delete(self):

self.assertFalse('google_oauth2_credentials' in flask.session)

if __name__ == '__main__':

if __name__ == '__main__': # pragma: NO COVER
unittest.main()
4 changes: 4 additions & 0 deletions tests/test_gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,7 @@ def test_save_to_well_known_file(self):
credentials)
finally:
os.path.isdir = ORIGINAL_ISDIR


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,5 @@ def test_true(self):
self.assertEqual(True, HAS_CRYPTO)


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
4 changes: 4 additions & 0 deletions tests/test_keyring_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,7 @@ def acquire(self):

def release(self):
self._release_count += 1


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
4 changes: 4 additions & 0 deletions tests/test_service_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ def test_access_token(self):
self.assertFalse(self.credentials.access_token_expired)
self.assertEqual(token_response_second,
self.credentials.token_response)


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def test_ClientRedirectServer(self):
self.assertEqual(httpd.query_params.get('code'), code)


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()
4 changes: 4 additions & 0 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ def test_key_conversions(self):

# check we get the original dictionary back
self.assertEqual(d, dict(tuple_key))


if __name__ == '__main__': # pragma: NO COVER
unittest.main()
2 changes: 1 addition & 1 deletion tests/test_xsrfutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,5 @@ def testGenerateAndValidateToken(self):
action_id=TEST_ACTION_ID_1))


if __name__ == '__main__':
if __name__ == '__main__': # pragma: NO COVER
unittest.main()

0 comments on commit 3b6b4be

Please sign in to comment.