assertpy 2.35.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- assertpy/__init__.py +87 -0
- assertpy/_clustering.py +511 -0
- assertpy/_dangling.py +505 -0
- assertpy/_engine/__init__.py +1 -0
- assertpy/_engine/_builder_check_typing.py +1365 -0
- assertpy/_engine/_capable_typing.py +772 -0
- assertpy/_engine/_check_typing.py +753 -0
- assertpy/_engine/_compare.py +983 -0
- assertpy/_engine/_compat.py +38 -0
- assertpy/_engine/_contract.py +1926 -0
- assertpy/_engine/_diff.py +1058 -0
- assertpy/_engine/_equality.py +843 -0
- assertpy/_engine/_introspection.py +729 -0
- assertpy/_engine/_membership.py +522 -0
- assertpy/_engine/_mixin_base.py +258 -0
- assertpy/_engine/_negated_typing.py +2176 -0
- assertpy/_engine/_operations.py +75 -0
- assertpy/_engine/_ordering.py +884 -0
- assertpy/_engine/_pairing.py +70 -0
- assertpy/_engine/_path.py +158 -0
- assertpy/_engine/_poll_typing.py +6039 -0
- assertpy/_engine/_require.py +312 -0
- assertpy/_engine/_size.py +31 -0
- assertpy/_engine/_text.py +39 -0
- assertpy/_engine/_typing.py +1226 -0
- assertpy/_hints.py +1213 -0
- assertpy/_inline.py +484 -0
- assertpy/_matcher_impls.py +1876 -0
- assertpy/_passes.py +249 -0
- assertpy/_renamed.py +64 -0
- assertpy/_satisfies.py +835 -0
- assertpy/_snapshot_codec.py +290 -0
- assertpy/assertpy.py +2640 -0
- assertpy/async_assertions.py +864 -0
- assertpy/base.py +862 -0
- assertpy/behave_matchers.py +96 -0
- assertpy/bytes_mixin.py +158 -0
- assertpy/collection.py +528 -0
- assertpy/contains.py +1068 -0
- assertpy/dataframe.py +200 -0
- assertpy/date.py +327 -0
- assertpy/dict.py +249 -0
- assertpy/dynamic.py +222 -0
- assertpy/errors.py +782 -0
- assertpy/exception.py +838 -0
- assertpy/extracting.py +266 -0
- assertpy/file.py +324 -0
- assertpy/helpers.py +747 -0
- assertpy/http_mixin.py +218 -0
- assertpy/json_mixin.py +1265 -0
- assertpy/matchers.py +639 -0
- assertpy/numeric.py +696 -0
- assertpy/outcome.py +163 -0
- assertpy/py.typed +0 -0
- assertpy/pytest_plugin.py +1650 -0
- assertpy/snapshot.py +1031 -0
- assertpy/string.py +803 -0
- assertpy/warning.py +137 -0
- assertpy-2.35.0.dist-info/METADATA +324 -0
- assertpy-2.35.0.dist-info/RECORD +63 -0
- assertpy-2.35.0.dist-info/WHEEL +4 -0
- assertpy-2.35.0.dist-info/entry_points.txt +2 -0
- assertpy-2.35.0.dist-info/licenses/LICENSE +28 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Internal compatibility shims.
|
|
2
|
+
|
|
3
|
+
``Self`` entered the standard library's `typing` in Python 3.11; on 3.10 it is provided by
|
|
4
|
+
``typing_extensions``. Re-exporting it from one place lets every mixin import ``Self`` without repeating
|
|
5
|
+
the version gate, and lets ``typing_extensions`` be dropped as a runtime dependency on Python 3.11+.
|
|
6
|
+
|
|
7
|
+
``BaseExceptionGroup`` is a builtin from Python 3.11; on 3.10 it comes from the ``exceptiongroup``
|
|
8
|
+
backport when installed, and otherwise degrades to an empty tuple so ``isinstance`` is simply always
|
|
9
|
+
``False`` (a 3.10 interpreter without the backport cannot have produced a group anyway).
|
|
10
|
+
|
|
11
|
+
``LoggerAdapter`` gained ``__class_getitem__`` in 3.11. A base class is an expression the interpreter
|
|
12
|
+
evaluates, which ``from __future__ import annotations`` does not defer, so spelling the argument
|
|
13
|
+
directly raised ``TypeError: 'type' object is not subscriptable`` on 3.10 at import. Gated on
|
|
14
|
+
``TYPE_CHECKING`` rather than on the version, so a checker sees the argument whatever it targets: an
|
|
15
|
+
unparameterised base reads as ``LoggerAdapter[Unknown]`` and takes the whole class with it.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import logging
|
|
19
|
+
import sys
|
|
20
|
+
from typing import TYPE_CHECKING
|
|
21
|
+
|
|
22
|
+
if sys.version_info >= (3, 11):
|
|
23
|
+
from builtins import BaseExceptionGroup
|
|
24
|
+
from typing import Self
|
|
25
|
+
else: # pragma: no cover - exercised only on Python 3.10
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
from exceptiongroup import BaseExceptionGroup # ty: ignore[unresolved-import] # optional 3.10 backport
|
|
30
|
+
except ImportError:
|
|
31
|
+
BaseExceptionGroup = ()
|
|
32
|
+
|
|
33
|
+
if TYPE_CHECKING:
|
|
34
|
+
_LoggerAdapter = logging.LoggerAdapter[logging.Logger]
|
|
35
|
+
else:
|
|
36
|
+
_LoggerAdapter = logging.LoggerAdapter
|
|
37
|
+
|
|
38
|
+
__all__ = ["BaseExceptionGroup", "Self", "_LoggerAdapter"]
|