MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _read

Method _read

lib/sqlalchemy/testing/profiling.py:198–215  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

196 ) % (self.fname)
197
198 def _read(self):
199 try:
200 profile_f = open(self.fname)
201 except OSError:
202 return
203 for lineno, line in enumerate(profile_f):
204 line = line.strip()
205 if not line or line.startswith("#"):
206 continue
207
208 test_key, platform_key, counts = line.split()
209 per_fn = self.data[test_key]
210 per_platform = per_fn[platform_key]
211 c = [int(count) for count in counts.split(",")]
212 per_platform["counts"] = c
213 per_platform["lineno"] = lineno + 1
214 per_platform["current_count"] = 0
215 profile_f.close()
216
217 def _write(self):
218 print("Writing profile file %s" % self.fname)

Callers 1

__init__Method · 0.95

Calls 5

openFunction · 0.85
stripMethod · 0.80
splitMethod · 0.80
startswithMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected