MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / result

Method result

lib/sqlalchemy/testing/profiling.py:126–151  ·  view source on GitHub ↗
(self, callcount)

Source from the content-addressed store, hash-verified

124 )
125
126 def result(self, callcount):
127 test_key = _current_test
128 per_fn = self.data[test_key]
129 per_platform = per_fn[self.platform_key]
130
131 if "counts" not in per_platform:
132 per_platform["counts"] = counts = []
133 else:
134 counts = per_platform["counts"]
135
136 if "current_count" not in per_platform:
137 per_platform["current_count"] = current_count = 0
138 else:
139 current_count = per_platform["current_count"]
140
141 has_count = len(counts) > current_count
142
143 if not has_count:
144 counts.append(callcount)
145 if self.write:
146 self._write()
147 result = None
148 else:
149 result = per_platform["lineno"], counts[current_count]
150 per_platform["current_count"] += 1
151 return result
152
153 def reset_count(self):
154 test_key = _current_test

Callers 1

count_functionsFunction · 0.80

Calls 2

_writeMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected