Skip to content

Commit

Permalink
Test implict aiohttp's TCP to HTTP connector change (#2741)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
viniciusdc and pre-commit-ci[bot] committed Sep 25, 2024
1 parent b2afe1a commit 1549693
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/tests_deployment/test_dask_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import pytest

from tests.tests_deployment import constants
from tests.tests_deployment.utils import get_jupyterhub_token, monkeypatch_ssl_context

monkeypatch_ssl_context()
from tests.tests_deployment.utils import get_jupyterhub_token


@pytest.fixture
Expand All @@ -15,7 +13,17 @@ def dask_gateway_object():
os.environ["JUPYTERHUB_API_TOKEN"] = get_jupyterhub_token(
"dask-gateway-pytest-token"
)
return dask_gateway.Gateway(

# Create custom class from Gateway that disables the tls/ssl verification
# to do that we will override the self._request_kwargs dictionary within the
# __init__, targeting aiohttp.ClientSession.request method

class DaskGateway(dask_gateway.Gateway):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._request_kwargs.update({"ssl": False})

return DaskGateway(
address=f"https://{constants.NEBARI_HOSTNAME}/{constants.GATEWAY_ENDPOINT}",
auth="jupyterhub",
proxy_address=f"tcp://{constants.NEBARI_HOSTNAME}:8786",
Expand Down

0 comments on commit 1549693

Please sign in to comment.