Skip to content

Commit

Permalink
Testing Python 3.13 (#242)
Browse files Browse the repository at this point in the history
* Adding `Python 3.13`.
* Fix for tests.
* Bump version
  • Loading branch information
mindflayer authored Sep 16, 2024
1 parent a42efda commit 90e8fbb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # , 'pypy3.10'
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', ' 3.13.0-rc.2', 'pypy3.10']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion mocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

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

__version__ = "3.12.9"
__version__ = "3.13.0"
5 changes: 3 additions & 2 deletions mocket/mocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
true_socketpair = socket.socketpair
true_ssl_wrap_socket = getattr(
ssl, "wrap_socket", None
) # in Py3.12 it's only under SSLContext
) # from Py3.12 it's only under SSLContext
true_ssl_socket = ssl.SSLSocket
true_ssl_context = ssl.SSLContext
true_inet_pton = socket.inet_pton
Expand All @@ -83,6 +83,7 @@ def __set__(self, *args):
minimum_version = FakeSetter()
options = FakeSetter()
verify_mode = FakeSetter()
verify_flags = FakeSetter()


class FakeSSLContext(SuperFakeSSLContext):
Expand All @@ -102,7 +103,7 @@ def check_hostname(self):
return self._check_hostname

@check_hostname.setter
def check_hostname(self, *args):
def check_hostname(self, _):
self._check_hostname = False

def __init__(self, sock=None, server_hostname=None, _context=None, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development",
Expand Down
12 changes: 10 additions & 2 deletions tests/main/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,18 @@ def test_request_bodies(self):
@mocketize(truesocket_recording_dir=os.path.dirname(__file__))
def test_truesendall_with_dump_from_recording(self):
requests.get(
"http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/ip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)
requests.get(
"http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/gzip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)

dump_filename = os.path.join(
Expand Down
12 changes: 10 additions & 2 deletions tests/main/test_http_with_xxhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ class HttpEntryTestCase(HttpTestCase):
@mocketize(truesocket_recording_dir=os.path.dirname(__file__))
def test_truesendall_with_dump_from_recording(self):
requests.get(
"http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/ip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)
requests.get(
"http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/gzip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)

dump_filename = os.path.join(
Expand Down

0 comments on commit 90e8fbb

Please sign in to comment.