Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"FakeSSLContext",
)

__version__ = "3.13.3"
__version__ = "3.13.4"
2 changes: 1 addition & 1 deletion mocket/decorators/async_mocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",)
2 changes: 1 addition & 1 deletion mocket/decorators/mocketizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ def wrapper(
return test(*args, **kwargs)


mocketize = get_mocketize(wrapper_=wrapper)
mocketize = get_mocketize(wrapper)
15 changes: 7 additions & 8 deletions mocket/utils.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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__ = (
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies = [
"decorator>=4.0.0",
"urllib3>=1.25.3",
"h11",
"typing-extensions",
]
dynamic = ["version"]

Expand Down Expand Up @@ -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
Expand Down