def test_inject_validate_fail_pyopenssl(self) -> None:
        """
        Injection should not be supported if pyOpenSSL is too old.
        """
        try:
            return_val = Mock()
            del return_val._x509
            with patch("OpenSSL.crypto.X509", return_value=return_val):
                with pytest.raises(ImportError):
                    inject_into_urllib3()
        finally:
            # `inject_into_urllib3` is not supposed to succeed.
            # If it does, this test should fail, but we need to
            # clean up so that subsequent tests are unaffected.
            extract_from_urllib3()

        Injection should not be supported if pyOpenSSL is too old.
        
test/contrib/test_pyopenssl_dependencies.py