| 403 | # Custom HTML reporter to clean up module names. |
| 404 | from coverage.html import HtmlReporter |
| 405 | class CustomHtmlReporter(HtmlReporter): |
| 406 | def find_code_units(self, morfs): |
| 407 | super(CustomHtmlReporter, self).find_code_units(morfs) |
| 408 | for cu in self.code_units: |
| 409 | nameparts = cu.name.split(os.sep) |
| 410 | if 'IPython' not in nameparts: |
| 411 | continue |
| 412 | ix = nameparts.index('IPython') |
| 413 | cu.name = '.'.join(nameparts[ix:]) |
| 414 | |
| 415 | # Reimplement the html_report method with our custom reporter |
| 416 | cov.get_data() |
no outgoing calls