class_docstr: Run Python tests using IPython.testing.iptest
class_docstr_tok: ["Run","Python","tests","using","IPython.testing.iptest"]
code: def add_coverage(self):
      try:
          sources = test_sections[self.section].includes
      except KeyError:
          sources = ["IPython"]
  
      coverage_rc = (
          "[run]\n"
          "data_file = {data_file}\n"
          "source =\n"
          "  {source}\n"
      ).format(
          data_file=os.path.abspath(".coverage." + self.section),
          source="\n  ".join(sources),
      )
      config_file = os.path.join(self.workingdir.name, ".coveragerc")
      with open(config_file, "w") as f:
          f.write(coverage_rc)
  
      self.env["COVERAGE_PROCESS_START"] = config_file
      self.pycmd = (
          "import coverage; coverage.process_startup(); " + self.pycmd
      )
  
imports: from __future__ import print_function
  import argparse
  import json
  import multiprocessing.pool
  import os
  import stat
  import re
  import requests
  import shutil
  import signal
  import sys
  import subprocess
  import time
  from .iptest import have, test_group_names, test_sections, StreamCapturer, test_for
  from IPython.utils.path import compress_user
  from IPython.utils.py3compat import bytes_to_str
  from IPython.utils.sysinfo import get_sys_info
  from IPython.utils.tempdir import TemporaryDirectory
  from IPython.utils.text import strip_ansi
label_desc: Use image node_id 6 for calling the PyTestController obj's underlying member method code with example usage: obj.add_coverage() without return types