antithesis._assertinfo
Basic Assertion Information
This module contains classes used to contain the details for basic assertions.
class
AssertType(builtins.str, enum.Enum):
Used to differentiate type of basic assertions
ALWAYS =
<AssertType.ALWAYS: 'always'>
SOMETIMES =
<AssertType.SOMETIMES: 'sometimes'>
REACHABILITY =
<AssertType.REACHABILITY: 'reachability'>
class
AssertionKind(builtins.str, enum.Enum):
Which assertion function a declaration came from.
This is the typed form of the display_type field of serialized
assertion events; the enum value is that string, which is also how the
triage report labels the property. It is distinct from AssertType,
the three-way wire-level type, which cannot tell always from
always_or_unreachable, or reachable from unreachable, without
also consulting must_hit.
ALWAYS =
<AssertionKind.ALWAYS: 'Always'>
ALWAYS_OR_UNREACHABLE =
<AssertionKind.ALWAYS_OR_UNREACHABLE: 'AlwaysOrUnreachable'>
SOMETIMES =
<AssertionKind.SOMETIMES: 'Sometimes'>
REACHABLE =
<AssertionKind.REACHABLE: 'Reachable'>
UNREACHABLE =
<AssertionKind.UNREACHABLE: 'Unreachable'>
class
AssertInfo:
Used to contain assertion details.
Attributes:
- _hit (bool): True for runtime assertions, False if from an Assertion Catalog
- _must_hit (bool): True if assertion must be hit at runtime
- _assert_type (str): Logical handling type for a basic assertion
- _display_type (str): Human readable name for a basic assertion
- _message (str): Unique message associated with a basic assertion
- _condition (bool): Runtime condition for the basic assertion
- _id (str): Unique id for the basic assertion
- _loc_info (Dict[str, Union[str, int]]): Caller information for the basic assertion (runtime and catalog)
- _details (Mapping[str, Any]): Named details associated with a basic assertion at runtime
AssertInfo( hit: bool, must_hit: bool, assert_type: str, display_type: str, message: str, condition: bool, assert_id: str, loc_info: Dict[str, Union[str, int]], details: Mapping[str, Any])
loc_info: Dict[str, Union[str, int]]
Dict[str, Union[str, int]]: Basic Assertion caller information (runtime and catalog)