aboutsummaryrefslogtreecommitdiff
path: root/tests/test_service_account.py
diff options
context:
space:
mode:
authorPat Ferate <pferate+github@gmail.com>2016-07-26 09:47:22 -0700
committerPat Ferate <pferate+github@gmail.com>2016-08-09 14:15:13 -0700
commitc359c401e74f26c2b73403f7a756ccb93b571f32 (patch)
tree1fb118866cd5e73ad04e7a9d275bd29ffae72c48 /tests/test_service_account.py
parent0fd8c61d93711e23a31f07c613f042caa0c0b6ee (diff)
downloadoauth2client-c359c401e74f26c2b73403f7a756ccb93b571f32.tar.gz
Migrate test runner to py.test
Migrating test runner from `unittest2`/`nose` to `pytest`. The pytest runner is also compatible with both unittest and nose tests. Some of the benefits of PyTest include: * using plain asserts * function-based fixtures instead of setUp and tearDown * no strange camelCase methods
Diffstat (limited to 'tests/test_service_account.py')
-rw-r--r--tests/test_service_account.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_service_account.py b/tests/test_service_account.py
index 755a79b..b5ae482 100644
--- a/tests/test_service_account.py
+++ b/tests/test_service_account.py
@@ -45,6 +45,8 @@ def datafile(filename):
class ServiceAccountCredentialsTests(unittest2.TestCase):
def setUp(self):
+ self.orig_signer = crypt.Signer
+ self.orig_verifier = crypt.Verifier
self.client_id = '123'
self.service_account_email = 'dummy@google.com'
self.private_key_id = 'ABCDEF'
@@ -58,6 +60,10 @@ class ServiceAccountCredentialsTests(unittest2.TestCase):
client_id=self.client_id,
)
+ def tearDown(self):
+ crypt.Signer = self.orig_signer
+ crypt.Verifier = self.orig_verifier
+
def test__to_json_override(self):
signer = object()
creds = service_account.ServiceAccountCredentials(