diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74e4cda..b7a1e1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: exclude: helm/ args: [ --unsafe ] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.7.4" + rev: "v0.11.2" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/LICENSE b/LICENSE index 2788c4b..db61222 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017-2024 Giorgio Salluzzo and individual contributors. All rights reserved. +Copyright (c) 2017-2025 Giorgio Salluzzo and individual contributors. All rights reserved. Copyright (c) 2013-2017 Andrea de Marco, Giorgio Salluzzo and individual contributors. All rights reserved. diff --git a/Makefile b/Makefile index 07d5d45..ff6a32e 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ test: types @echo "" safetest: - export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; $(VENV_PATH)/pytest + SKIP_TRUE_REDIS=1 SKIP_TRUE_HTTP=1 $(VENV_PATH)/pytest publish: clean install-test-requirements uv build --package mocket --sdist --wheel diff --git a/README.rst b/README.rst index 82bf6c3..8b08200 100644 --- a/README.rst +++ b/README.rst @@ -63,8 +63,8 @@ The starting point to understand how to use *Mocket* to write a custom mock is t As next step, you are invited to have a look at the implementation of both the mocks it provides: -- HTTP mock (similar to HTTPretty) - https://github.com/mindflayer/python-mocket/blob/master/mocket/mockhttp.py -- Redis mock (basic implementation) - https://github.com/mindflayer/python-mocket/blob/master/mocket/mockredis.py +- HTTP mock (similar to HTTPretty) - https://github.com/mindflayer/python-mocket/blob/master/mocket/mocks/mockhttp.py +- Redis mock (basic implementation) - https://github.com/mindflayer/python-mocket/blob/master/mocket/mocks/mockredis.py Please also have a look at the huge test suite: diff --git a/mocket/__init__.py b/mocket/__init__.py index c785bba..fc941ca 100644 --- a/mocket/__init__.py +++ b/mocket/__init__.py @@ -31,4 +31,4 @@ "FakeSSLContext", ) -__version__ = "3.13.3" +__version__ = "3.13.4" diff --git a/mocket/decorators/async_mocket.py b/mocket/decorators/async_mocket.py index 40b763a..3839d5f 100644 --- a/mocket/decorators/async_mocket.py +++ b/mocket/decorators/async_mocket.py @@ -16,7 +16,7 @@ async def wrapper( return await test(*args, **kwargs) -async_mocketize = get_mocketize(wrapper_=wrapper) +async_mocketize = get_mocketize(wrapper) __all__ = ("async_mocketize",) diff --git a/mocket/decorators/mocketizer.py b/mocket/decorators/mocketizer.py index 2bf2b9c..4020d52 100644 --- a/mocket/decorators/mocketizer.py +++ b/mocket/decorators/mocketizer.py @@ -92,4 +92,4 @@ def wrapper( return test(*args, **kwargs) -mocketize = get_mocketize(wrapper_=wrapper) +mocketize = get_mocketize(wrapper) diff --git a/mocket/utils.py b/mocket/utils.py index ab29377..60ddd9f 100644 --- a/mocket/utils.py +++ b/mocket/utils.py @@ -1,8 +1,11 @@ from __future__ import annotations import binascii +import contextlib from typing import Callable +import decorator + from mocket.compat import decode_from_bytes, encode_to_bytes @@ -28,14 +31,10 @@ def hexload(string: str) -> bytes: def get_mocketize(wrapper_: Callable) -> Callable: - import decorator - - if decorator.__version__ < "5": # type: ignore[attr-defined] # pragma: no cover - return decorator.decorator(wrapper_) - return decorator.decorator( # type: ignore[call-arg] # kwsyntax - wrapper_, - kwsyntax=True, - ) + # trying to support different versions of `decorator` + with contextlib.suppress(TypeError): + return decorator.decorator(wrapper_, kwsyntax=True) # type: ignore[call-arg,unused-ignore] + return decorator.decorator(wrapper_) __all__ = ( diff --git a/pyproject.toml b/pyproject.toml index 5418304..fbe4746 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ dependencies = [ "decorator>=4.0.0", "urllib3>=1.25.3", "h11", + "typing-extensions", ] dynamic = ["version"] @@ -124,6 +125,7 @@ files = [ ] strict = true warn_unused_configs = true +suppress_unused_ignore = true ignore_missing_imports = true warn_redundant_casts = true warn_unused_ignores = true pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy