MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/trace.py:155–179  ·  view source on GitHub ↗
(self, counts=None, calledfuncs=None, infile=None,
                 callers=None, outfile=None)

Source from the content-addressed store, hash-verified

153
154class CoverageResults:
155 def __init__(self, counts=None, calledfuncs=None, infile=None,
156 callers=None, outfile=None):
157 self.counts = counts
158 if self.counts is None:
159 self.counts = {}
160 self.counter = self.counts.copy() # map (filename, lineno) to count
161 self.calledfuncs = calledfuncs
162 if self.calledfuncs is None:
163 self.calledfuncs = {}
164 self.calledfuncs = self.calledfuncs.copy()
165 self.callers = callers
166 if self.callers is None:
167 self.callers = {}
168 self.callers = self.callers.copy()
169 self.infile = infile
170 self.outfile = outfile
171 if self.infile:
172 # Try to merge existing counts file.
173 try:
174 with open(self.infile, 'rb') as f:
175 counts, calledfuncs, callers = pickle.load(f)
176 self.update(self.__class__(counts, calledfuncs, callers=callers))
177 except (OSError, EOFError, ValueError) as err:
178 print(("Skipping counts file %r: %s"
179 % (self.infile, err)), file=sys.stderr)
180
181 def is_ignored_filename(self, filename):
182 """Return True if the filename does not refer to a file

Callers

nothing calls this directly

Calls 6

updateMethod · 0.95
openFunction · 0.70
printFunction · 0.50
copyMethod · 0.45
loadMethod · 0.45
__class__Method · 0.45

Tested by

no test coverage detected