-
-
Notifications
You must be signed in to change notification settings - Fork 426
Skip rsa tests when dependencies not met #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tests/test_oauth1_session.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than doing this four-line check, I'd suggest doing this at the top of the file:
try:
import cryptography
except ImportError:
cryptography = Noneand then using the skipUnless() decorator on tests that require the cryptography module:
@unittest.skipUnless(cryptography, "cryptography module is required")
def test_signature_methods(self, generate_nonce, generate_timestamp):
# ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the import at the top.
Unfortunately skipUnless isn't available on Python 2.6's unittest, and using monkey patching for that is going too far IMO. We could switch to using unittest2 on Python 2.6.
b27e798 to
c974576
Compare
|
Travis build with revised patch and the #168 patch: https://travis-ci.org/jayvdb/requests-oauthlib/builds/82236300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we bothering to print anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that the unittest output shows something useful. i.e.
https://travis-ci.org/jayvdb/requests-oauthlib/jobs/82236301#L176
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to add unittest2 support so that this workaround is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be better, yeah.
Skip rsa tests when dependencies not met
Fixes issue #164