Selfie
Loading...
Searching...
No Matches
pytest_selfie.plugin.FSImplementation Class Reference
Inheritance diagram for pytest_selfie.plugin.FSImplementation:

Public Member Functions

Exception assert_failed (self, message, expected=None, actual=None)

Detailed Description

Definition at line 35 of file plugin.py.

Member Function Documentation

◆ assert_failed()

Exception pytest_selfie.plugin.FSImplementation.assert_failed ( self,
message,
expected = None,
actual = None )

Definition at line 36 of file plugin.py.

36 def assert_failed(self, message, expected=None, actual=None) -> Exception:
37 if expected is None and actual is None:
38 return AssertionError(message)
39
40 expected_str = self.__nullable_to_string(expected, "")
41 actual_str = self.__nullable_to_string(actual, "")
42
43 if not expected_str and not actual_str and (expected is None or actual is None):
44 on_null = "(null)"
45 return self.__comparison_assertion(
46 message,
47 self.__nullable_to_string(expected, on_null),
48 self.__nullable_to_string(actual, on_null),
49 )
50 else:
51 return self.__comparison_assertion(message, expected_str, actual_str)
52

The documentation for this class was generated from the following file: