Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 63112b9

Browse files
committed
Monkeypatch.
1 parent 218dd38 commit 63112b9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/test_integration.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,19 @@ class TestRequestsAdapter(SocketLevelTest):
455455
# This uses HTTP/2.
456456
h2 = True
457457

458-
def test_adapter_received_values(self):
458+
def test_adapter_received_values(self, monkeypatch):
459459
self.set_up()
460460

461+
# We need to patch the ssl_wrap_socket method to ensure that we
462+
# forcefully upgrade.
463+
old_wrap_socket = hyper.http11.connection.wrap_socket
464+
465+
def wrap(*args):
466+
sock, _ = old_wrap_socket(*args)
467+
return sock, 'h2'
468+
469+
monkeypatch.setattr(hyper.http11.connection, 'wrap_socket', wrap)
470+
461471
data = []
462472
send_event = threading.Event()
463473

0 commit comments

Comments
 (0)