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.
Files changed (63) hide show
  1. assertpy/__init__.py +87 -0
  2. assertpy/_clustering.py +511 -0
  3. assertpy/_dangling.py +505 -0
  4. assertpy/_engine/__init__.py +1 -0
  5. assertpy/_engine/_builder_check_typing.py +1365 -0
  6. assertpy/_engine/_capable_typing.py +772 -0
  7. assertpy/_engine/_check_typing.py +753 -0
  8. assertpy/_engine/_compare.py +983 -0
  9. assertpy/_engine/_compat.py +38 -0
  10. assertpy/_engine/_contract.py +1926 -0
  11. assertpy/_engine/_diff.py +1058 -0
  12. assertpy/_engine/_equality.py +843 -0
  13. assertpy/_engine/_introspection.py +729 -0
  14. assertpy/_engine/_membership.py +522 -0
  15. assertpy/_engine/_mixin_base.py +258 -0
  16. assertpy/_engine/_negated_typing.py +2176 -0
  17. assertpy/_engine/_operations.py +75 -0
  18. assertpy/_engine/_ordering.py +884 -0
  19. assertpy/_engine/_pairing.py +70 -0
  20. assertpy/_engine/_path.py +158 -0
  21. assertpy/_engine/_poll_typing.py +6039 -0
  22. assertpy/_engine/_require.py +312 -0
  23. assertpy/_engine/_size.py +31 -0
  24. assertpy/_engine/_text.py +39 -0
  25. assertpy/_engine/_typing.py +1226 -0
  26. assertpy/_hints.py +1213 -0
  27. assertpy/_inline.py +484 -0
  28. assertpy/_matcher_impls.py +1876 -0
  29. assertpy/_passes.py +249 -0
  30. assertpy/_renamed.py +64 -0
  31. assertpy/_satisfies.py +835 -0
  32. assertpy/_snapshot_codec.py +290 -0
  33. assertpy/assertpy.py +2640 -0
  34. assertpy/async_assertions.py +864 -0
  35. assertpy/base.py +862 -0
  36. assertpy/behave_matchers.py +96 -0
  37. assertpy/bytes_mixin.py +158 -0
  38. assertpy/collection.py +528 -0
  39. assertpy/contains.py +1068 -0
  40. assertpy/dataframe.py +200 -0
  41. assertpy/date.py +327 -0
  42. assertpy/dict.py +249 -0
  43. assertpy/dynamic.py +222 -0
  44. assertpy/errors.py +782 -0
  45. assertpy/exception.py +838 -0
  46. assertpy/extracting.py +266 -0
  47. assertpy/file.py +324 -0
  48. assertpy/helpers.py +747 -0
  49. assertpy/http_mixin.py +218 -0
  50. assertpy/json_mixin.py +1265 -0
  51. assertpy/matchers.py +639 -0
  52. assertpy/numeric.py +696 -0
  53. assertpy/outcome.py +163 -0
  54. assertpy/py.typed +0 -0
  55. assertpy/pytest_plugin.py +1650 -0
  56. assertpy/snapshot.py +1031 -0
  57. assertpy/string.py +803 -0
  58. assertpy/warning.py +137 -0
  59. assertpy-2.35.0.dist-info/METADATA +324 -0
  60. assertpy-2.35.0.dist-info/RECORD +63 -0
  61. assertpy-2.35.0.dist-info/WHEEL +4 -0
  62. assertpy-2.35.0.dist-info/entry_points.txt +2 -0
  63. 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"]