File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 12
12
import shutil
13
13
import socket
14
14
import ssl
15
+ import sys
15
16
import tempfile
16
17
import typing
17
18
import zlib
@@ -1346,11 +1347,17 @@ def http_socket_handler(listener: socket.socket) -> None:
1346
1347
with pytest .raises (MaxRetryError ):
1347
1348
proxy .request ("GET" , "https://example.com" , retries = 0 )
1348
1349
1349
- assert capsys .readouterr ().out == (
1350
- "send: b'CONNECT example.com:443 HTTP/1.1\\ r\\ n"
1351
- "Host: example.com:443\\ r\\ n\\ r\\ n'"
1352
- "\n header: Example-Header: Example-Value\r \n \n "
1353
- )
1350
+ if sys .version_info >= (3 , 12 ):
1351
+ assert capsys .readouterr ().out == (
1352
+ "send: b'CONNECT example.com:443 HTTP/1.1\\ r\\ n"
1353
+ "Host: example.com:443\\ r\\ n\\ r\\ n'"
1354
+ "\n header: Example-Header: Example-Value\r \n \n header: \r \n \n "
1355
+ )
1356
+ else :
1357
+ assert capsys .readouterr ().out == (
1358
+ "send: b'CONNECT example.com:443 HTTP/1.0\\ r\\ n\\ r\\ n'"
1359
+ "\n header: Example-Header: Example-Value\r \n \n "
1360
+ )
1354
1361
1355
1362
1356
1363
class TestSSL (SocketDummyServerTestCase ):
You can’t perform that action at this time.
0 commit comments