def pretend_to_be_nose_with_cover(self, erase: bool = False, cd: bool = False) -> None:
        """This is what the nose --with-cover plugin does."""
        self.make_file("no_biggie.py", """\
            a = 1
            b = 2
            if b == 1:
                c = 4
            """)
        self.make_file("sub/hold.txt", "")

        cov = coverage.Coverage()
        if erase:
            cov.combine()
            cov.erase()
        cov.load()
        self.start_import_stop(cov, "no_biggie")
        if cd:
            os.chdir("sub")
        cov.combine()
        cov.save()
        cov.report(["no_biggie.py"], show_missing=True)
        assert self.stdout() == textwrap.dedent("""\
            Name           Stmts   Miss  Cover   Missing
            --------------------------------------------
            no_biggie.py       4      1    75%   4
            --------------------------------------------
            TOTAL              4      1    75%
            """)
        if cd:
            os.chdir("..")
This is what the nose --with-cover plugin does.
tests/test_api.py