Skip to content

Commit 90e8fbb

Browse files
authored
Testing Python 3.13 (#242)
* Adding `Python 3.13`. * Fix for tests. * Bump version
1 parent a42efda commit 90e8fbb

File tree

6 files changed

+26
-8
lines changed

6 files changed

+26
-8
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-20.04
2323
strategy:
2424
matrix:
25-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # , 'pypy3.10'
25+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', ' 3.13.0-rc.2', 'pypy3.10']
2626

2727
steps:
2828
- uses: actions/checkout@v4

mocket/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
__all__ = ("async_mocketize", "mocketize", "Mocket", "MocketEntry", "Mocketizer")
55

6-
__version__ = "3.12.9"
6+
__version__ = "3.13.0"

mocket/mocket.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
true_socketpair = socket.socketpair
6565
true_ssl_wrap_socket = getattr(
6666
ssl, "wrap_socket", None
67-
) # in Py3.12 it's only under SSLContext
67+
) # from Py3.12 it's only under SSLContext
6868
true_ssl_socket = ssl.SSLSocket
6969
true_ssl_context = ssl.SSLContext
7070
true_inet_pton = socket.inet_pton
@@ -83,6 +83,7 @@ def __set__(self, *args):
8383
minimum_version = FakeSetter()
8484
options = FakeSetter()
8585
verify_mode = FakeSetter()
86+
verify_flags = FakeSetter()
8687

8788

8889
class FakeSSLContext(SuperFakeSSLContext):
@@ -102,7 +103,7 @@ def check_hostname(self):
102103
return self._check_hostname
103104

104105
@check_hostname.setter
105-
def check_hostname(self, *args):
106+
def check_hostname(self, _):
106107
self._check_hostname = False
107108

108109
def __init__(self, sock=None, server_hostname=None, _context=None, *args, **kwargs):

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ classifiers = [
1919
"Programming Language :: Python :: 3.10",
2020
"Programming Language :: Python :: 3.11",
2121
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
2223
"Programming Language :: Python :: Implementation :: CPython",
2324
"Programming Language :: Python :: Implementation :: PyPy",
2425
"Topic :: Software Development",

tests/main/test_http.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,18 @@ def test_request_bodies(self):
308308
@mocketize(truesocket_recording_dir=os.path.dirname(__file__))
309309
def test_truesendall_with_dump_from_recording(self):
310310
requests.get(
311-
"http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"}
311+
"http://httpbin.local/ip",
312+
headers={
313+
"user-agent": "Fake-User-Agent",
314+
"Accept-Encoding": "gzip, deflate, zstd",
315+
},
312316
)
313317
requests.get(
314-
"http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"}
318+
"http://httpbin.local/gzip",
319+
headers={
320+
"user-agent": "Fake-User-Agent",
321+
"Accept-Encoding": "gzip, deflate, zstd",
322+
},
315323
)
316324

317325
dump_filename = os.path.join(

tests/main/test_http_with_xxhash.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ class HttpEntryTestCase(HttpTestCase):
1111
@mocketize(truesocket_recording_dir=os.path.dirname(__file__))
1212
def test_truesendall_with_dump_from_recording(self):
1313
requests.get(
14-
"http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"}
14+
"http://httpbin.local/ip",
15+
headers={
16+
"user-agent": "Fake-User-Agent",
17+
"Accept-Encoding": "gzip, deflate, zstd",
18+
},
1519
)
1620
requests.get(
17-
"http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"}
21+
"http://httpbin.local/gzip",
22+
headers={
23+
"user-agent": "Fake-User-Agent",
24+
"Accept-Encoding": "gzip, deflate, zstd",
25+
},
1826
)
1927

2028
dump_filename = os.path.join(

0 commit comments

Comments
 (0)