Skip to content
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

[Generic] Fix failing GenericOAuthenticator tests #339

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

GeorgianaElena
Copy link
Member

Creating the AsyncHTTPClient with force_instance=True attribute in GenericOAuthenticator made the tests fail because the mocked http client was not being used anymore and instead an actual AsyncHttpClient instance was being created and used (ref: https://github.com/tornadoweb/tornado/blob/master/tornado/httpclient.py#L200).

This PR forces the GenericOAuthenticator tests use the mocked http client.

@consideRatio
Copy link
Member

I still don't fully grasp this PR, but I learned enough to say it LGTM! I have never properly read up on Pytest mocking, and still haven't, but read enough to grasp what goes on with the patch() call thanks to this guide: https://realpython.com/python-mock-library/#patch

@consideRatio consideRatio merged commit e133e91 into jupyterhub:master Mar 10, 2020
@GeorgianaElena GeorgianaElena deleted the fix_failing_tests branch March 10, 2020 07:45
@consideRatio consideRatio changed the title Fix failing GenericOAuthenticator tests [Generic] Fix failing GenericOAuthenticator tests Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants