diff options
author | Pat Ferate <pferate+github@gmail.com> | 2016-07-26 09:47:22 -0700 |
---|---|---|
committer | Pat Ferate <pferate+github@gmail.com> | 2016-08-09 14:15:13 -0700 |
commit | c359c401e74f26c2b73403f7a756ccb93b571f32 (patch) | |
tree | 1fb118866cd5e73ad04e7a9d275bd29ffae72c48 /tests/test_jwt.py | |
parent | 0fd8c61d93711e23a31f07c613f042caa0c0b6ee (diff) | |
download | oauth2client-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_jwt.py')
-rw-r--r-- | tests/test_jwt.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_jwt.py b/tests/test_jwt.py index ecc58e8..67fc9c1 100644 --- a/tests/test_jwt.py +++ b/tests/test_jwt.py @@ -235,9 +235,13 @@ class PEMCryptTestsOpenSSL(CryptTests): class SignedJwtAssertionCredentialsTests(unittest2.TestCase): def setUp(self): + self.orig_signer = crypt.Signer self.format_ = 'p12' crypt.Signer = crypt.OpenSSLSigner + def tearDown(self): + crypt.Signer = self.orig_signer + def _make_credentials(self): private_key = datafile('privatekey.' + self.format_) signer = crypt.Signer.from_string(private_key) @@ -310,17 +314,25 @@ class PEMSignedJwtAssertionCredentialsOpenSSLTests( SignedJwtAssertionCredentialsTests): def setUp(self): + self.orig_signer = crypt.Signer self.format_ = 'pem' crypt.Signer = crypt.OpenSSLSigner + def tearDown(self): + crypt.Signer = self.orig_signer + class PEMSignedJwtAssertionCredentialsPyCryptoTests( SignedJwtAssertionCredentialsTests): def setUp(self): + self.orig_signer = crypt.Signer self.format_ = 'pem' crypt.Signer = crypt.PyCryptoSigner + def tearDown(self): + crypt.Signer = self.orig_signer + class TestHasOpenSSLFlag(unittest2.TestCase): |