MCPcopy Create free account
hub / github.com/pybind/pybind11 / Output

Class Output

tests/conftest.py:71–94  ·  view source on GitHub ↗

Basic output post-processing and comparison

Source from the content-addressed store, hash-verified

69
70
71class Output:
72 """Basic output post-processing and comparison"""
73
74 def __init__(self, string):
75 self.string = string
76 self.explanation = []
77
78 def __str__(self):
79 return self.string
80
81 __hash__ = None
82
83 def __eq__(self, other):
84 # Ignore constructor/destructor output which is prefixed with "###"
85 a = [
86 line
87 for line in self.string.strip().splitlines()
88 if not line.startswith("###")
89 ]
90 b = _strip_and_dedent(other).splitlines()
91 if a == b:
92 return True
93 self.explanation = _make_explanation(a, b)
94 return False
95
96
97class Unordered(Output):

Callers 2

__eq__Method · 0.85
stderrMethod · 0.85

Calls

no outgoing calls

Tested by 2

__eq__Method · 0.68
stderrMethod · 0.68