Injects `pyOpenSSL` module to make sure `requests` will use it.
()
| 82 | |
| 83 | @pytest.fixture(autouse=True, scope='session') |
| 84 | def pyopenssl_inject(): |
| 85 | """ |
| 86 | Injects `pyOpenSSL` module to make sure `requests` will use it. |
| 87 | <https://github.com/psf/requests/pull/5443#issuecomment-645740394> |
| 88 | """ |
| 89 | if IS_PYOPENSSL: |
| 90 | try: |
| 91 | import urllib3.contrib.pyopenssl |
| 92 | urllib3.contrib.pyopenssl.inject_into_urllib3() |
| 93 | except ModuleNotFoundError: |
| 94 | pytest.fail('Missing "pyopenssl" module.') |
| 95 | |
| 96 | yield |