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,75 @@
1
+ """Which public operations reach a verdict, and what the ones that do not do instead.
2
+
3
+ Both proxies need the same answer. ``not_`` inverts a verdict and ``check()`` reports one, so an
4
+ operation that reaches no verdict means nothing through either, and both used to accept them:
5
+ ``assert_that(1).not_.check()`` failed with "Expected <1> to NOT satisfy: check()", and
6
+ ``assert_that([1]).check().first()`` answered that an assertion passed when none had run.
7
+
8
+ A verdict is ``self.error(...)``, the one failure entry point every assertion goes through. What is
9
+ registered here is the complement: the operations that reach it through nothing, listed by what they
10
+ do instead. Written as the exceptions rather than as the whole surface, because 134 of the 152 public
11
+ names assert and a register of those would be a second copy of the API, kept in step by hand.
12
+
13
+ `tests/test_operation_contract.py` re-derives this set from the source and fails on any difference, so
14
+ a new operation that asserts nothing cannot quietly become negatable or checkable.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ from typing import Final
20
+
21
+ CONFIGURES: Final = "configures"
22
+ TRANSFORMS: Final = "transforms"
23
+ DESCRIBES: Final = "describes"
24
+ POLLS: Final = "polls"
25
+
26
+ # the proxies word their own sentence: `not_` and `check()` refuse the same operation for different reasons
27
+ WHAT_IT_DOES: Final = {
28
+ CONFIGURES: "only sets an expectation and asserts nothing on its own",
29
+ TRANSFORMS: "hands back a different value instead of asserting",
30
+ DESCRIBES: "only sets the failure description",
31
+ POLLS: "runs a whole chain until it holds",
32
+ }
33
+
34
+ # the builder's own machinery, named rather than filtered, so a new one is declared before the gate takes it
35
+ NOT_AN_OPERATION: Final = frozenset({"builder", "check", "error", "not_", "value"})
36
+
37
+ # the members handing the subject back: no assertion left uncalled for the dangling check, none to wrap for a proxy
38
+ HANDS_THE_SUBJECT_BACK: Final = frozenset({"val", "value"})
39
+
40
+ # the hybrids: named, since "reaches `self.error()`" does not separate a verdict from a precondition
41
+ ALSO_ASSERTS: Final = frozenset(
42
+ {
43
+ "caused_by",
44
+ "error_of",
45
+ "extracting_group",
46
+ "has_root_cause",
47
+ "matches_with_groups",
48
+ "when_called_with",
49
+ }
50
+ )
51
+
52
+ WITHOUT_A_VERDICT: Final[dict[str, str]] = {
53
+ "raises": CONFIGURES,
54
+ "does_not_raise": CONFIGURES,
55
+ "warns": CONFIGURES,
56
+ "does_not_warn": CONFIGURES,
57
+ "at_json_path": TRANSFORMS,
58
+ "decoded_as": TRANSFORMS,
59
+ "decoded_as_json": TRANSFORMS,
60
+ "element": TRANSFORMS,
61
+ "extracting": TRANSFORMS,
62
+ "filtered_on": TRANSFORMS,
63
+ "first": TRANSFORMS,
64
+ "flat_mapped": TRANSFORMS,
65
+ "last": TRANSFORMS,
66
+ "mapped": TRANSFORMS,
67
+ "raised": TRANSFORMS,
68
+ "returned": TRANSFORMS,
69
+ # `errors()` takes no expectation, so once a group is caught there is nothing it can be wrong about
70
+ "errors": TRANSFORMS,
71
+ "single": TRANSFORMS,
72
+ "described_as": DESCRIBES,
73
+ "eventually": POLLS,
74
+ "eventually_sync": POLLS,
75
+ }