Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mocket for openSUSE:Factory checked in at 2025-07-02 12:07:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mocket (Old) and /work/SRC/openSUSE:Factory/.python-mocket.new.7067 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mocket" Wed Jul 2 12:07:47 2025 rev:44 rq:1289679 version:3.13.9 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes 2025-06-10 08:57:04.647057657 +0200 +++ /work/SRC/openSUSE:Factory/.python-mocket.new.7067/python-mocket.changes 2025-07-02 12:08:24.899994983 +0200 @@ -1,0 +2,9 @@ +Tue Jun 24 19:36:55 UTC 2025 - Sebastian Wagner <se...@sebix.at> + +- Update to version 3.13.9: + * Better Strict Mode by @mindflayer in #298 +- Update to version 3.13.8: + * Fixture event_loop got removed from pytest-asyncio by @mindflayer in #294 + * Match querystring for multiple responses in httpretty plugin by @wilhelmklopp in #295 + +------------------------------------------------------------------- Old: ---- mocket-3.13.7.tar.gz New: ---- mocket-3.13.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mocket.spec ++++++ --- /var/tmp/diff_new_pack.DGNrUw/_old 2025-07-02 12:08:25.632025536 +0200 +++ /var/tmp/diff_new_pack.DGNrUw/_new 2025-07-02 12:08:25.632025536 +0200 @@ -36,7 +36,7 @@ %{?sle15_python_module_pythons} Name: python-mocket%{psuffix} -Version: 3.13.7 +Version: 3.13.9 Release: 0 Summary: Python socket mock framework License: BSD-3-Clause ++++++ mocket-3.13.7.tar.gz -> mocket-3.13.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/PKG-INFO new/mocket-3.13.9/PKG-INFO --- old/mocket-3.13.7/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: mocket -Version: 3.13.7 +Version: 3.13.9 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Project-URL: Homepage, https://pypi.org/project/mocket Project-URL: Repository, https://github.com/mindflayer/python-mocket @@ -84,7 +84,7 @@ .. image:: https://img.shields.io/pypi/dm/mocket :target: https://pypistats.org/packages/mocket -.. image:: mocket.png +.. image:: https://raw.githubusercontent.com/mindflayer/python-mocket/main/mocket.png :height: 256px :width: 256px :alt: Mocket logo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/README.rst new/mocket-3.13.9/README.rst --- old/mocket-3.13.7/README.rst 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/README.rst 2020-02-02 01:00:00.000000000 +0100 @@ -14,7 +14,7 @@ .. image:: https://img.shields.io/pypi/dm/mocket :target: https://pypistats.org/packages/mocket -.. image:: mocket.png +.. image:: https://raw.githubusercontent.com/mindflayer/python-mocket/main/mocket.png :height: 256px :width: 256px :alt: Mocket logo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/mocket/__init__.py new/mocket-3.13.9/mocket/__init__.py --- old/mocket-3.13.7/mocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/mocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -31,4 +31,4 @@ "FakeSSLContext", ) -__version__ = "3.13.7" +__version__ = "3.13.9" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/mocket/decorators/mocketizer.py new/mocket-3.13.9/mocket/decorators/mocketizer.py --- old/mocket-3.13.7/mocket/decorators/mocketizer.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/mocket/decorators/mocketizer.py 2020-02-02 01:00:00.000000000 +0100 @@ -15,9 +15,9 @@ self.instance = instance self.truesocket_recording_dir = truesocket_recording_dir self.namespace = namespace or str(id(self)) - MocketMode().STRICT = strict_mode + MocketMode.STRICT = strict_mode if strict_mode: - MocketMode().STRICT_ALLOWED = strict_mode_allowed or [] + MocketMode.STRICT_ALLOWED = strict_mode_allowed or [] elif strict_mode_allowed: raise ValueError( "Allowed locations are only accepted when STRICT mode is active." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/mocket/mode.py new/mocket-3.13.9/mocket/mode.py --- old/mocket-3.13.7/mocket/mode.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/mocket/mode.py 2020-02-02 01:00:00.000000000 +0100 @@ -9,7 +9,7 @@ from typing import NoReturn -class MocketMode: +class _MocketMode: __shared_state: ClassVar[dict[str, Any]] = {} STRICT: ClassVar = None STRICT_ALLOWED: ClassVar = None @@ -31,7 +31,10 @@ return host_allowed or location in self.STRICT_ALLOWED @staticmethod - def raise_not_allowed() -> NoReturn: + def raise_not_allowed( + address: tuple[str, int] | None = None, + data: bytes | None = None, + ) -> NoReturn: current_entries = [ (location, "\n ".join(map(str, entries))) for location, entries in Mocket._entries.items() @@ -39,7 +42,20 @@ formatted_entries = "\n".join( [f" {location}:\n {entries}" for location, entries in current_entries] ) - raise StrictMocketException( - "Mocket tried to use the real `socket` module while STRICT mode was active.\n" - f"Registered entries:\n{formatted_entries}" + msg = ( + "Mocket tried to use the real `socket` module while STRICT mode was active." ) + if address: + host, port = address + msg += f"\nAttempted address: {host}:{port}" + if data: + from mocket.compat import decode_from_bytes + + preview = decode_from_bytes(data).split("\r\n", 1)[0][:200] + msg += f"\nSent data: {preview}" + + msg += f"\nRegistered entries:\n{formatted_entries}" + raise StrictMocketException(msg) + + +MocketMode = _MocketMode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/mocket/plugins/httpretty/__init__.py new/mocket-3.13.9/mocket/plugins/httpretty/__init__.py --- old/mocket-3.13.7/mocket/plugins/httpretty/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/mocket/plugins/httpretty/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -90,7 +90,12 @@ Response.set_base_headers = Response.original_set_base_headers # type: ignore[method-assign] if responses: - Entry.register(method, uri, *responses) + Entry.register( + method, + uri, + *responses, + match_querystring=match_querystring, + ) else: Entry.single_register( method, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/mocket/socket.py new/mocket-3.13.9/mocket/socket.py --- old/mocket-3.13.7/mocket/socket.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/mocket/socket.py 2020-02-02 01:00:00.000000000 +0100 @@ -228,8 +228,8 @@ raise exc def true_sendall(self, data: bytes, *args: Any, **kwargs: Any) -> bytes: - if not MocketMode().is_allowed(self._address): - MocketMode.raise_not_allowed() + if not MocketMode.is_allowed(self._address): + MocketMode.raise_not_allowed(self._address, data) # try to get the response from recordings if Mocket._record_storage: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/tests/test_asyncio.py new/mocket-3.13.9/tests/test_asyncio.py --- old/mocket-3.13.7/tests/test_asyncio.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/tests/test_asyncio.py 2020-02-02 01:00:00.000000000 +0100 @@ -12,7 +12,7 @@ from mocket.plugins.aiohttp_connector import MocketTCPConnector -def test_asyncio_record_replay(event_loop): +def test_asyncio_record_replay(): async def test_asyncio_connection(): reader, writer = await asyncio.open_connection( host="google.com", @@ -33,7 +33,7 @@ with tempfile.TemporaryDirectory() as temp_dir: with Mocketizer(truesocket_recording_dir=temp_dir): - event_loop.run_until_complete(test_asyncio_connection()) + asyncio.run(test_asyncio_connection()) files = glob.glob(f"{temp_dir}/*.json") assert len(files) == 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.13.7/tests/test_mode.py new/mocket-3.13.9/tests/test_mode.py --- old/mocket-3.13.7/tests/test_mode.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.13.9/tests/test_mode.py 2020-02-02 01:00:00.000000000 +0100 @@ -52,6 +52,8 @@ str(exc_info.value) == """ Mocket tried to use the real `socket` module while STRICT mode was active. +Attempted address: httpbin.local:80 +Sent data: GET /ip HTTP/1.1 Registered entries: ('httpbin.local', 80): Entry(method='GET', schema='http', location=('httpbin.local', 80), path='/user.agent', query='') @@ -67,5 +69,5 @@ @pytest.mark.parametrize("strict_mode_on", (False, True)) def test_strict_mode_allowed_or_not(strict_mode_on): with Mocketizer(strict_mode=strict_mode_on): - assert MocketMode().is_allowed("foobar.com") is not strict_mode_on - assert MocketMode().is_allowed(("foobar.com", 443)) is not strict_mode_on + assert MocketMode.is_allowed("foobar.com") is not strict_mode_on + assert MocketMode.is_allowed(("foobar.com", 443)) is not strict_mode_on