diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ff623d0..1f1c8efa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/mocket/__init__.py b/mocket/__init__.py index 6335ce87..00284855 100644 --- a/mocket/__init__.py +++ b/mocket/__init__.py @@ -3,4 +3,4 @@ __all__ = ("async_mocketize", "mocketize", "Mocket", "MocketEntry", "Mocketizer") -__version__ = "3.12.9" +__version__ = "3.13.0" diff --git a/mocket/mocket.py b/mocket/mocket.py index cca0a4cd..daa0e608 100644 --- a/mocket/mocket.py +++ b/mocket/mocket.py @@ -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 @@ -83,6 +83,7 @@ def __set__(self, *args): minimum_version = FakeSetter() options = FakeSetter() verify_mode = FakeSetter() + verify_flags = FakeSetter() class FakeSSLContext(SuperFakeSSLContext): @@ -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): diff --git a/pyproject.toml b/pyproject.toml index 34e887b9..cdb4d9b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/tests/main/test_http.py b/tests/main/test_http.py index 21fe448d..d335bcc5 100644 --- a/tests/main/test_http.py +++ b/tests/main/test_http.py @@ -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( diff --git a/tests/main/test_http_with_xxhash.py b/tests/main/test_http_with_xxhash.py index 4600bf37..a074a864 100644 --- a/tests/main/test_http_with_xxhash.py +++ b/tests/main/test_http_with_xxhash.py @@ -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(