MCPcopy Create free account
hub / github.com/ipython/ipython / add_coverage

Method add_coverage

IPython/testing/iptestcontroller.py:179–196  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

177 self.cmd.extend(['--with-xunit', '--xunit-file', xunit_file])
178
179 def add_coverage(self):
180 try:
181 sources = test_sections[self.section].includes
182 except KeyError:
183 sources = ['IPython']
184
185 coverage_rc = ("[run]\n"
186 "data_file = {data_file}\n"
187 "source =\n"
188 " {source}\n"
189 ).format(data_file=os.path.abspath('.coverage.'+self.section),
190 source="\n ".join(sources))
191 config_file = os.path.join(self.workingdir.name, '.coveragerc')
192 with open(config_file, 'w') as f:
193 f.write(coverage_rc)
194
195 self.env['COVERAGE_PROCESS_START'] = config_file
196 self.pycmd = "import coverage; coverage.process_startup(); " + self.pycmd
197
198 def launch(self, buffer_output=False):
199 self.cmd[2] = self.pycmd

Callers 1

setupMethod · 0.95

Calls 2

formatMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected