tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-14/popen-gw30'), _trace=<pluggy._tracing.TagTracerSub object at 0x7f1aeb42f520>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-14/popen-gw30'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory):
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:36: AssertionError
_____________________________________________________________ ERROR at setup of VirtualenvTest.test_bug_888[python -m coverage] _____________________________________________________________
[gw30] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-14/popen-gw30'), _trace=<pluggy._tracing.TagTracerSub object at 0x7f1aeb42f520>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-14/popen-gw30'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory):
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:36: AssertionError
========================================================================================= FAILURES ==========================================================================================
______________________________________________________________________________ CmdLineStdoutTest.test_version _______________________________________________________________________________
[gw29] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_cmdline.CmdLineStdoutTest object at 0x7f2b11bbadc0>

    def test_version(self):
        self.command_line("--version")
        out = self.stdout()
        assert "ersion " in out
        if env.C_TRACER:
>           assert "with C extension" in out
E           AssertionError: assert 'with C extension' in 'Coverage.py, version 7.0.1 without C extension\nFull documentation is at https://coverage.readthedocs.io\n'

tests/test_cmdline.py:975: AssertionError
___________________________________________________________________________ DebugTraceTest.test_debug_sys_ctracer ___________________________________________________________________________
[gw36] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_debug.DebugTraceTest object at 0x7fccb3451880>

    def test_debug_sys_ctracer(self):
        out_text = self.f1_debug_output(["sys"])
        tracer_line = re_line(r"CTracer:", out_text).strip()
        if env.C_TRACER:
            expected = "CTracer: available"
        else:
            expected = "CTracer: unavailable"
>       assert expected == tracer_line
E       AssertionError: assert 'CTracer: available' == 'CTracer: unavailable'
E         - CTracer: unavailable
E         ?          --
E         + CTracer: available

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_debug.py:200: AssertionError
_______________________________________________________________________________ FileReporterTest.test_zipfile _______________________________________________________________________________
[gw20] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_filereporter.FileReporterTest object at 0x7fd05e458a00>

    def test_zipfile(self):
        sys.path.append("tests/zip1.zip")

        # Test that we can get files out of zipfiles, and read their source files.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7fd6c6f8c4b0>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7fc0296a33b0>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7f28362f2330>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7f9fec5b32b0>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        For each morf in `morfs`, if it should be reported on (based on the omit
        and include configuration options), yield a pair, the `FileReporter` and
        `Analysis` for the morf.

        """
        file_reporters = coverage._get_file_reporters(morfs)
        config = coverage.config

        if config.report_include:
            matcher = GlobMatcher(prep_patterns(config.report_include), "report_include")
            file_reporters = [fr for fr in file_reporters if matcher.match(fr.filename)]

        if config.report_omit:
            matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit")
            file_reporters = [fr for fr in file_reporters if not matcher.match(fr.filename)]

        if not file_reporters:
>           raise NoDataError("No data to report.")

        For each morf in `morfs`, if it should be reported on (based on the omit
        and include configuration options), yield a pair, the `FileReporter` and
        `Analysis` for the morf.

        """
        file_reporters = coverage._get_file_reporters(morfs)
        config = coverage.config

        if config.report_include:
            matcher = GlobMatcher(prep_patterns(config.report_include), "report_include")
            file_reporters = [fr for fr in file_reporters if matcher.match(fr.filename)]

        if config.report_omit:
            matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit")
            file_reporters = [fr for fr in file_reporters if not matcher.match(fr.filename)]

        if not file_reporters:
>           raise NoDataError("No data to report.")

        For each morf in `morfs`, if it should be reported on (based on the omit
        and include configuration options), yield a pair, the `FileReporter` and
        `Analysis` for the morf.

        """
        file_reporters = coverage._get_file_reporters(morfs)
        config = coverage.config

        if config.report_include:
            matcher = GlobMatcher(prep_patterns(config.report_include), "report_include")
            file_reporters = [fr for fr in file_reporters if matcher.match(fr.filename)]

        if config.report_omit:
            matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit")
            file_reporters = [fr for fr in file_reporters if not matcher.match(fr.filename)]

        if not file_reporters:
>           raise NoDataError("No data to report.")

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.
        # The message can be in two forms:
        #   Disabling plug-in '...' due to previous exception
        # or:
        #   Disabling plug-in '...' due to an exception:
        print([str(w) for w in warns.list])
        warns = [w for w in warns.list if issubclass(w.category, CoverageWarning)]
        assert len(warns) == 1
        warnmsg = warns[0].message.args[0]
>       assert f"Disabling plug-in '{module_name}.{plugin_name}' due to " in warnmsg
E       assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_plugins.py:648: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
['{message : CoverageWarning("Plugin file tracers (bad_plugin.Plugin) aren\'t supported with PyTracer"), category : \'CoverageWarning\', filename : \'/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/coverage/control.py\', lineno : 539, line : None}']
______________________________________________________________________________ GoodFileTracerTest.test_plugin2 ______________________________________________________________________________
[gw24] linux -- Python 3.8.16 /usr/bin/python3

self = <coverage.parser.ByteParser object at 0x7f1ed97f5610>, text = 'line 0\nline 1\nline 2\nline 3\nline 4\nline 5\nline 6\n', code = None
filename = '/tmp/pytest-of-tkloczko/pytest-14/popen-gw24/t19/foo_7.html'

    @contract(text='unicode')
    def __init__(self, text, code=None, filename=None):
        self.text = text
        if code:
            self.code = code
        else:
            try:
>               self.code = compile(text, filename, "exec")
E                 File "/tmp/pytest-of-tkloczko/pytest-14/popen-gw24/t19/foo_7.html", line 1
E                   line 0
E                        ^
E               SyntaxError: invalid syntax

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/coverage/parser.py:361: SyntaxError

The above exception was the direct cause of the following exception:

self = <tests.test_plugins.GoodFileTracerTest object at 0x7f1ed99ea250>

    def test_plugin2(self):
        self.make_render_and_caller()

        cov = coverage.Coverage(omit=["*quux*"])
        CheckUniqueFilenames.hook(cov, '_should_trace')
        CheckUniqueFilenames.hook(cov, '_check_include_omit_etc')
        cov.set_option("run:plugins", ["tests.plugin2"])

        self.start_import_stop(cov, "caller")

        # The way plugin2 works, a file named foo_7.html will be claimed to
        # have 7 lines in it.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7f8b5111e830>('# Oh noes!')

E           coverage.exceptions.NoSource: No source for code: '/src/try_ABC.zz'.

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/coverage/python.py:60: NoSource
________________________________________________________________________ GoodFileTracerTest.test_plugin2_with_branch ________________________________________________________________________
[gw4] linux -- Python 3.8.16 /usr/bin/python3

self = <coverage.parser.ByteParser object at 0x7f45801c5c40>, text = 'line 0\nline 1\nline 2\nline 3\nline 4\nline 5\nline 6\n', code = None
filename = '/tmp/pytest-of-tkloczko/pytest-14/popen-gw4/t17/foo_7.html'

    @contract(text='unicode')
    def __init__(self, text, code=None, filename=None):
        self.text = text
        if code:
            self.code = code
        else:
            try:
>               self.code = compile(text, filename, "exec")
E                 File "/tmp/pytest-of-tkloczko/pytest-14/popen-gw4/t17/foo_7.html", line 1
E                   line 0
E                        ^
E               SyntaxError: invalid syntax

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/coverage/parser.py:361: SyntaxError

The above exception was the direct cause of the following exception:

self = <tests.test_plugins.GoodFileTracerTest object at 0x7f4580631be0>

    def test_plugin2_with_branch(self):
        self.make_render_and_caller()

        cov = coverage.Coverage(branch=True, omit=["*quux*"])
        CheckUniqueFilenames.hook(cov, '_should_trace')
        CheckUniqueFilenames.hook(cov, '_check_include_omit_etc')
        cov.set_option("run:plugins", ["tests.plugin2"])

        self.start_import_stop(cov, "caller")

        # The way plugin2 works, a file named foo_7.html will be claimed to
        # have 7 lines in it.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(w.message.args[0] for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.
        # The message can be in two forms:
        #   Disabling plug-in '...' due to previous exception
        # or:
        #   Disabling plug-in '...' due to an exception:
        print([str(w) for w in warns.list])
        warns = [w for w in warns.list if issubclass(w.category, CoverageWarning)]
        assert len(warns) == 1
        warnmsg = warns[0].message.args[0]
>       assert f"Disabling plug-in '{module_name}.{plugin_name}' due to " in warnmsg
E       assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_plugins.py:648: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
['{message : CoverageWarning("Plugin file tracers (bad_plugin.Plugin) aren\'t supported with PyTracer"), category : \'CoverageWarning\', filename : \'/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/coverage/control.py\', lineno : 539, line : None}']
_________________________________________________________________________ ProcessTest.test_tests_dir_is_importable __________________________________________________________________________
[gw17] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.ProcessTest object at 0x7f9a7051fe20>

    def test_tests_dir_is_importable(self):
        # Checks that we can import modules from the tests directory at all!
        self.make_file("mycode.py", """\
            import covmod1
            import covmodzip1
            a = 1
            print('done')
            """)

        self.assert_doesnt_exist(".coverage")
        out = self.run_command("coverage run mycode.py")
        self.assert_exists(".coverage")
>       assert out == 'done\n'
E       assert "Traceback (m...covmodzip1'\n" == 'done\n'
E         - done
E         + Traceback (most recent call last):
E         +   File "mycode.py", line 2, in <module>
E         +     import covmodzip1
E         + ModuleNotFoundError: No module named 'covmodzip1'

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_process.py:50: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "mycode.py", line 2, in <module>
    import covmodzip1
ModuleNotFoundError: No module named 'covmodzip1'

_____________________________________________________________________ GetZipBytesTest.test_get_encoded_zip_files[utf-8] _____________________________________________________________________
[gw32] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_python.GetZipBytesTest object at 0x7f2d52f55ac0>, encoding = 'utf-8'

    @pytest.mark.parametrize(
        "encoding",
        ["utf-8", "gb2312", "hebrew", "shift_jis", "cp1252"],
    )
    def test_get_encoded_zip_files(self, encoding):
        # See igor.py, do_zipmods, for the text of these files.
        zip_file = "tests/zipmods.zip"
        sys.path.append(zip_file)       # So we can import the files.
        filename = zip_file + "/encoded_" + encoding + ".py"
        filename = os_sep(filename)
        zip_data = get_zip_bytes(filename)
>       zip_text = zip_data.decode(encoding)
E       AttributeError: 'NoneType' object has no attribute 'decode'

tests/test_python.py:33: AttributeError
____________________________________________________________________ GetZipBytesTest.test_get_encoded_zip_files[gb2312] _____________________________________________________________________
[gw32] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_python.GetZipBytesTest object at 0x7f2d52f55910>, encoding = 'gb2312'

    @pytest.mark.parametrize(
        "encoding",
        ["utf-8", "gb2312", "hebrew", "shift_jis", "cp1252"],
    )
    def test_get_encoded_zip_files(self, encoding):
        # See igor.py, do_zipmods, for the text of these files.
        zip_file = "tests/zipmods.zip"
        sys.path.append(zip_file)       # So we can import the files.
        filename = zip_file + "/encoded_" + encoding + ".py"
        filename = os_sep(filename)
        zip_data = get_zip_bytes(filename)
>       zip_text = zip_data.decode(encoding)
E       AttributeError: 'NoneType' object has no attribute 'decode'

tests/test_python.py:33: AttributeError
____________________________________________________________________ GetZipBytesTest.test_get_encoded_zip_files[hebrew] _____________________________________________________________________
[gw32] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_python.GetZipBytesTest object at 0x7f2d52f55b80>, encoding = 'hebrew'

    @pytest.mark.parametrize(
        "encoding",
        ["utf-8", "gb2312", "hebrew", "shift_jis", "cp1252"],
    )
    def test_get_encoded_zip_files(self, encoding):
        # See igor.py, do_zipmods, for the text of these files.
        zip_file = "tests/zipmods.zip"
        sys.path.append(zip_file)       # So we can import the files.
        filename = zip_file + "/encoded_" + encoding + ".py"
        filename = os_sep(filename)
        zip_data = get_zip_bytes(filename)
>       zip_text = zip_data.decode(encoding)
E       AttributeError: 'NoneType' object has no attribute 'decode'

tests/test_python.py:33: AttributeError
___________________________________________________________________ GetZipBytesTest.test_get_encoded_zip_files[shift_jis] ___________________________________________________________________
[gw32] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_python.GetZipBytesTest object at 0x7f2d52f55cd0>, encoding = 'shift_jis'

    @pytest.mark.parametrize(
        "encoding",
        ["utf-8", "gb2312", "hebrew", "shift_jis", "cp1252"],
    )
    def test_get_encoded_zip_files(self, encoding):
        # See igor.py, do_zipmods, for the text of these files.
        zip_file = "tests/zipmods.zip"
        sys.path.append(zip_file)       # So we can import the files.
        filename = zip_file + "/encoded_" + encoding + ".py"
        filename = os_sep(filename)
        zip_data = get_zip_bytes(filename)
>       zip_text = zip_data.decode(encoding)
E       AttributeError: 'NoneType' object has no attribute 'decode'

tests/test_python.py:33: AttributeError
_______________________________________________________________________________ ProcessTest.test_fullcoverage _______________________________________________________________________________
[gw47] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.ProcessTest object at 0x7fe25a906640>

    @pytest.mark.expensive
    @pytest.mark.skipif(not env.C_TRACER, reason="fullcoverage only works with the C tracer.")
    @pytest.mark.skipif(env.METACOV, reason="Can't test fullcoverage when measuring ourselves")
    def test_fullcoverage(self):
        # fullcoverage is a trick to get stdlib modules measured from
        # the very beginning of the process. Here we import os and
        # then check how many lines are measured.
        self.make_file("getenv.py", """\
            import os
            print("FOOEY == %s" % os.getenv("FOOEY"))
            """)

        fullcov = os.path.join(os.path.dirname(coverage.__file__), "fullcoverage")
        self.set_environ("FOOEY", "BOO")
        self.set_environ("PYTHONPATH", fullcov)
        out = self.run_command("python -X frozen_modules=off -m coverage run -L getenv.py")
>       assert out == "FOOEY == BOO\n"
E       AssertionError: assert '/usr/bin/pyt...ed coverage\n' == 'FOOEY == BOO\n'
E         - FOOEY == BOO
E         + /usr/bin/python3: No module named coverage

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_process.py:570: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
/usr/bin/python3: No module named coverage

__________________________________________________________ ProcessStartupWithSourceTest.test_pth_and_source_work_together[main--] ___________________________________________________________
[gw15] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.ProcessStartupWithSourceTest object at 0x7f5756a8a370>, dashm = '', package = '', source = 'main'

    @pytest.mark.parametrize("dashm", ["-m", ""])
    @pytest.mark.parametrize("package", ["pkg", ""])
    @pytest.mark.parametrize("source", ["main", "sub"])
    def test_pth_and_source_work_together(self, dashm, package, source):
        """Run the test for a particular combination of factors.

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

          Create the data file here with bogus data in
        # it.
        data = coverage.CoverageData(".mycovdata")
        data.add_lines({os.path.abspath('sub.py'): range(100)})
        data.write()

        self.make_file("coverage.ini", """\
            [run]
            data_file = .mycovdata
            """)
        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")
        import main             # pylint: disable=unused-import, import-error

        with open("out.txt") as f:
            assert f.read() == "Hello, world!\n"

        # Read the data from .coverage
        self.assert_exists(".mycovdata")
        data = coverage.CoverageData(".mycovdata")
        data.read()
>       assert line_counts(data)['sub.py'] == 3
E       assert 100 == 3

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_process.py:1179: AssertionError
________________________________________________________ ProcessStartupWithSourceTest.test_pth_and_source_work_together[sub-pkg--m] _________________________________________________________
[gw35] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.ProcessStartupWithSourceTest object at 0x7f2836261cd0>, dashm = '-m', package = 'pkg', source = 'sub'

    @pytest.mark.parametrize("dashm", ["-m", ""])
    @pytest.mark.parametrize("package", ["pkg", ""])
    @pytest.mark.parametrize("source", ["main", "sub"])
    def test_pth_and_source_work_together(self, dashm, package, source):
        """Run the test for a particular combination of factors.

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        """
        # First, is this even credible try_execfile.py output?
>       assert '"DATA": "xyzzy"' in actual
E       assert '"DATA": "xyzzy"' in "python3: can't open file '/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/covmain.zip': [Errno 2] No such file or directory\n"

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/test_process.py:671: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
{
    "DATA": "xyzzy",
    "FN_VAL": "my_fn('fooey')",
    "__builtins__.dir": [
        "ArithmeticError AssertionError AttributeError BaseException BlockingIOError BrokenPipeError BufferError BytesWarning ChildProcessError ConnectionAbortedError ConnectionError ConnectionRefusedError ConnectionResetError",
        "DeprecationWarning EOFError Ellipsis EnvironmentError Exception False FileExistsError FileNotFoundError FloatingPointError FutureWarning",
        "GeneratorExit IOError ImportError ImportWarning IndentationError IndexError InterruptedError IsADirectoryError",
        "KeyError KeyboardInterrupt LookupError MemoryError ModuleNotFoundError NameError None NotADirectoryError NotImplemented NotImplementedError",
        "OSError OverflowError PendingDeprecationWarning PermissionError ProcessLookupError RecursionError ReferenceError ResourceWarning RuntimeError RuntimeWarning",
        "StopAsyncIteration StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TimeoutError True TypeError",
        "UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning",
        "ValueError Warning ZeroDivisionError __build_class__ __debug__ __doc__ __import__ __loader__ __name__ __package__ __spec__",
        "abs all any ascii bin bool breakpoint bytearray bytes",
        "callable chr classmethod compile complex copyright credits delattr dict dir divmod",
        "enumerate eval exec exit filter float format frozenset getattr globals",
        "hasattr hash help hex id input int isinstance issubclass iter",
        "len license list locals map max memoryview min next object oct open ord",
        "pow print property quit range repr reversed round",
        "set setattr slice sorted staticmethod str sum super tuple type vars zip"
    ],
    "__builtins__.has_open": true,
    "__doc__": "Test file for run_python_file.\n\nThis file is executed two ways::\n\n    $ coverage run try_execfile.py\n\nand::\n\n    $ python try_execfile.py\n\nThe output is compared to see that the program execution context is the same\nunder coverage and under Python.\n\nIt is not crucial that the execution be identical, there are some differences\nthat are OK.  This program canonicalizes the output to gloss over those\ndifferences and get a clean diff.\n\n",
    "__file__": "run_me.py",
    "__loader__ exists": true,
    "__loader__.fullname": "__main__",
    "__main__.DATA": "xyzzy",
    "__name__": "__main__",
    "__package__": null,
    "__spec__ exists": false,
    "argv0": "run_me.py",
    "argv1-n": [],
    "os.getcwd": "/tmp/pytest-of-tkloczko/pytest-14/popen-gw8/t19",
    "path": [
        "/tmp/pytest-of-tkloczko/pytest-14/popen-gw8/t19",
        "/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages",
        "/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.0.1-2.fc35.x86_64/usr/lib/python3.8/site-packages",
        "/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/modules",
        "/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/zipmods.zip",
        "/usr/lib64/python38.zip",
        "/usr/lib64/python3.8",
        "/usr/lib64/python3.8/lib-dynload",
        "/usr/lib64/python3.8/site-packages",
        "/usr/lib/python3.8/site-packages"
    ]
}

python3: can't open file '/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/covmain.zip': [Errno 2] No such file or directory

__________________________________________________________ ProcessStartupWithSourceTest.test_pth_and_source_work_together[sub---m] __________________________________________________________
[gw9] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.ProcessStartupWithSourceTest object at 0x7f9fecb2bc10>, dashm = '-m', package = '', source = 'sub'

    @pytest.mark.parametrize("dashm", ["-m", ""])
    @pytest.mark.parametrize("package", ["pkg", ""])
    @pytest.mark.parametrize("source", ["main", "sub"])
    def test_pth_and_source_work_together(self, dashm, package, source):
        """Run the test for a particular combination of factors.

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname):
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename):
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            # Avoid 'with' so Jython can play along.
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

SKIPPED [2] tests/test_concurrency.py:478: Can't test: Couldn't trace with concurrency=eventlet, the module isn't installed.
SKIPPED [2] tests/test_concurrency.py:224: Can't test: Couldn't trace with concurrency=gevent, the module isn't installed.
SKIPPED [1] tests/test_concurrency.py:341: Can't run test without gevent installed.
SKIPPED [2] tests/test_concurrency.py:224: Can't test: Couldn't trace with concurrency=greenlet, the module isn't installed.
SKIPPED [1] tests/test_files.py:550: This test assumes Windows file system
SKIPPED [1] tests/test_files.py:662: Only need to run Windows tests on Windows.
SKIPPED [1] tests/test_misc.py:89: Contracts are disabled, can't test them
SKIPPED [1] tests/test_misc.py:99: Contracts are disabled, can't test them
SKIPPED [1] tests/test_misc.py:122: Contracts are disabled, can't test them
SKIPPED [1] tests/test_misc.py:109: Contracts are disabled, can't test them
SKIPPED [1] tests/test_oddball.py:209: This is too expensive for now (30s)
SKIPPED [1] tests/test_parser.py:432: Match-case is new in 3.10
SKIPPED [1] tests/test_phystokens.py:119: Soft keywords are new in Python 3.10
SKIPPED [1] tests/test_plugins.py:267: This test is only about PyTracer.
SKIPPED [1] tests/test_python.py:50: not windows
SKIPPED [1] tests/test_summary.py:730: .pyw files are only on Windows.
XFAIL tests/test_arcs.py::LoopArcTest::test_incorrect_loop_exit_bug_1175 - <3.10 traced final pass incorrectly
XFAIL tests/test_arcs.py::LoopArcTest::test_incorrect_if_bug_1175 - <3.10 traced final pass incorrectly
ERROR tests/test_venv.py::VirtualenvTest::test_third_party_venv_isnt_measured[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_third_party_venv_isnt_measured[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_us_in_venv_isnt_measured[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_us_in_venv_isnt_measured[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_isnt_measured[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_isnt_measured[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_with_dynamic_plugin[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_with_dynamic_plugin[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_installed_namespace_packages[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_installed_namespace_packages[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_bug_888[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_bug_888[python -m coverage] - assert 127 == 0
FAILED tests/test_cmdline.py::CmdLineStdoutTest::test_version - AssertionError: assert 'with C extension' in 'Coverage.py, version 7.0.1 without C extension\nFull documentation is at https://coverage.readthedocs.io\n'
FAILED tests/test_debug.py::DebugTraceTest::test_debug_sys_ctracer - AssertionError: assert 'CTracer: available' == 'CTracer: unavailable'
FAILED tests/test_filereporter.py::FileReporterTest::test_zipfile - ModuleNotFoundError: No module named 'zip1'
FAILED tests/test_plugins.py::GoodFileTracerTest::test_defer_to_python - AssertionError: assert ['Name       ...    3    50%'] == ['Name       ...    0   100%']
FAILED tests/test_plugins.py::PluginTest::test_plugin_sys_info - AssertionError: assert 'plugins.file_tracers: plugin_sys_info.Plugin' in ['-- sys -------------------------------------------------------', 'coverage_version: 7.0.1', 'coverage_module:...
FAILED tests/test_plugins.py::BadFileTracerTest::test_plugin_has_inherited_filereporter_method - Failed: DID NOT RAISE <class 'NotImplementedError'>
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_has_inherited_sourcefilename_method - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::GoodFileTracerTest::test_find_unexecuted - assert [1] == [99, 999, 9999]
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_fails - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_returns_triple - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_raises_error - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_returns_non_tuple - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_source_filename_fails - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_dynamic_source_filename_fails - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_fails_eventually - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_returns_wrong - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_returns_pair_of_strings - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_text_report - coverage.exceptions.NoDataError: No data to report.
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_html_report - coverage.exceptions.NoDataError: No data to report.
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_xml_report - coverage.exceptions.NoDataError: No data to report.
FAILED tests/test_plugins.py::BadFileTracerTest::test_source_filename_returns_wrong - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2 - coverage.exceptions.NotPython: Couldn't parse '/tmp/pytest-of-tkloczko/pytest-14/popen-gw24/t19/foo_7.html' as Python source: 'invalid syntax' at line 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_has_dynamic_source_filename_fails - assert 0 == 1
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin1 - coverage.exceptions.NoSource: No source for code: '/src/try_ABC.zz'.
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_branch - coverage.exceptions.NotPython: Couldn't parse '/tmp/pytest-of-tkloczko/pytest-14/popen-gw4/t17/foo_7.html' as Python source: 'invalid syntax' at line 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_has_no_file_tracer_method - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_process.py::ProcessTest::test_tests_dir_is_importable - assert "Traceback (m...covmodzip1'\n" == 'done\n'
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[utf-8] - AttributeError: 'NoneType' object has no attribute 'decode'
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[gb2312] - AttributeError: 'NoneType' object has no attribute 'decode'
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[hebrew] - AttributeError: 'NoneType' object has no attribute 'decode'
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[shift_jis] - AttributeError: 'NoneType' object has no attribute 'decode'
FAILED tests/test_process.py::ProcessTest::test_fullcoverage - AssertionError: assert '/usr/bin/pyt...ed coverage\n' == 'FOOEY == BOO\n'
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main--] - AssertionError: File '.coverage' should exist
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[cp1252] - AttributeError: 'NoneType' object has no attribute 'decode'
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main-pkg--m] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main---m] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub-pkg-] - AssertionError: File '.coverage' should exist
FAILED tests/test_summary.py::SummaryTest::test_report - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_process.py::ProcessStartupTest::test_subprocess_with_pth_files - assert 100 == 3
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub-pkg--m] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main-pkg-] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub--] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::EnvironmentTest::test_coverage_zip_is_like_python - assert '"DATA": "xyzzy"' in "python3: can't open file '/home/tkloczko/rpmbuild/BUILD/coveragepy-7.0.1/tests/covmain.zip': [Errno 2] No such file or directory\n"
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub---m] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupTest::test_subprocess_with_pth_files_and_parallel - KeyError: 'sub.py'
FAILED tests/test_testing.py::test_xdist_sys_path_nuttiness_is_fixed - AssertionError: assert '/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.0.1-...
FAILED tests/test_summary.py::SummaryTest::test_report_omitting - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_summary.py::SummaryTest::test_report_wildcard - AssertionError: assert 'TOTAL 4 2 50%' == 'TOTAL 4 0 100%'
FAILED tests/test_summary.py::SummaryTest::test_report_including - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_summary.py::SummaryTest::test_report_just_one - ModuleNotFoundError: No module named 'covmodzip1'
50 failed, 1226 passed, 26 skipped, 2 xfailed, 9 warnings, 12 errors in 14.88s
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-16a01919-b319-49f9-871c-afade6895c4c'
  warnings.warn(

Things like "python -m pip install " shout be replced by "pip install ".
I have no python executable and rinning python -m foo should not be used because python in such cases adds current irectory to sys.path which alwaysis nothing more than asking for troubles ..
Only this will bring few units to the working stata 😋
Now question only os why this .. why that assumption with only try writing a .pth file in a directory if there's already a .pth file there was necessary? 🤔
Adnd second is: it is really necessary to write some files to the sitelib? Fidling outside /tmp or source tree looks a bit odd .. 🤔

I'm going add in my packaging procedure tempporary those failing units to --deselect list to have some working baseline.

I can't reproduce what you are seeing.  Can you give me exact steps to reproduce your scenario?

Excact steps are listed in descriptio openig this ticket.
Just in case .. build and testing is performed fron non-root account.

Just tested 7.2.1.
Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.2.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.2.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
bringing up nodes...
............................................................................................................................................................s...s..x..........s.x.... [ 13%]
....................s.............................................F..........................................................................................s....................... [ 27%]
sss...s.s.........s..s........................s..s................................................................................................................................... [ 40%]
..........................F........................................F................................................................................................................. [ 54%]
..................................................................s.........................s......................................................................................... [ 68%]
................................s...............s.....s............s......F..F.FFFF.FFFF.FFFFFFF.FFFF.F.......Fs.F.F..F..F.....F.F...F......................F.............F....F...F. [ 81%]
......F.......F...........F............................................F..F........................F...F...............................................F............E..E..E.......F.. [ 95%]
........E..E..E......E.....E....E...E...E.E.s...F.F.FF.....                                                                                [100%]
========================================================================================== ERRORS ===========================================================================================
______________________________________________________ ERROR at setup of VirtualenvTest.test_third_party_venv_isnt_measured[coverage] _______________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
----------------------------------------------------------------------------------- Captured stdout setup -----------------------------------------------------------------------------------
/bin/sh: line 1: venv/bin/python: No such file or directory

_________________________________________________ ERROR at setup of VirtualenvTest.test_third_party_venv_isnt_measured[python -m coverage] __________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
_________________________________________________________ ERROR at setup of VirtualenvTest.test_us_in_venv_isnt_measured[coverage] __________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
____________________________________________________ ERROR at setup of VirtualenvTest.test_us_in_venv_isnt_measured[python -m coverage] _____________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
____________________________________________________________ ERROR at setup of VirtualenvTest.test_venv_isnt_measured[coverage] _____________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
_______________________________________________________ ERROR at setup of VirtualenvTest.test_venv_isnt_measured[python -m coverage] ________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
_________________________________________________________ ERROR at setup of VirtualenvTest.test_venv_with_dynamic_plugin[coverage] __________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
____________________________________________________ ERROR at setup of VirtualenvTest.test_venv_with_dynamic_plugin[python -m coverage] _____________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
_______________________________________________________ ERROR at setup of VirtualenvTest.test_installed_namespace_packages[coverage] ________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
__________________________________________________ ERROR at setup of VirtualenvTest.test_installed_namespace_packages[python -m coverage] ___________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
__________________________________________________________________ ERROR at setup of VirtualenvTest.test_bug_888[coverage] __________________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
_____________________________________________________________ ERROR at setup of VirtualenvTest.test_bug_888[python -m coverage] _____________________________________________________________
[gw39] linux -- Python 3.8.16 /usr/bin/python3

tmp_path_factory = TempPathFactory(_given_basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'), _trace=<pluggy._tracing.TagTracerSub object at 0x7fa2a1917e20>, _basetemp=PosixPath('/tmp/pytest-of-tkloczko/pytest-13/popen-gw39'))

    @pytest.fixture(scope="session", name="venv_world")
    def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
        """Create a virtualenv with a few test packages for VirtualenvTest to use.

        The first word of the command will be adjusted to run it from the
        venv/bin or venv\Scripts directory.

        Returns the text output of the command.
        """
        words = cmd.split()
        if env.WINDOWS:
            words[0] = fr"venv\Scripts\{words[0]}.exe"
        else:
            words[0] = fr"venv/bin/{words[0]}"
        status, output = run_command(" ".join(words))
        # Print the output so if it fails, we can tell what happened.
        print(output)
>       assert status == 0
E       assert 127 == 0

tests/test_venv.py:40: AssertionError
========================================================================================= FAILURES ==========================================================================================
______________________________________________________________________________ CmdLineStdoutTest.test_version _______________________________________________________________________________
[gw30] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_cmdline.CmdLineStdoutTest object at 0x7f5dae936640>

    def test_version(self) -> None:
        self.command_line("--version")
        out = self.stdout()
        assert "ersion " in out
        if env.C_TRACER:
>           assert "with C extension" in out
E           AssertionError: assert 'with C extension' in 'Coverage.py, version 7.2.1 without C extension\nFull documentation is at https://coverage.readthedocs.io/en/7.2.1\n'

tests/test_cmdline.py:1002: AssertionError
___________________________________________________________________________ DebugTraceTest.test_debug_sys_ctracer ___________________________________________________________________________
[gw22] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_debug.DebugTraceTest object at 0x7f22bd2a14f0>

    def test_debug_sys_ctracer(self) -> None:
        out_text = self.f1_debug_output(["sys"])
        tracer_line = re_line(r"CTracer:", out_text).strip()
        if env.C_TRACER:
            expected = "CTracer: available"
        else:
            expected = "CTracer: unavailable"
>       assert expected == tracer_line
E       AssertionError: assert 'CTracer: available' == 'CTracer: unavailable'
E         - CTracer: unavailable
E         ?          --
E         + CTracer: available

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/tests/test_debug.py:200: AssertionError
_______________________________________________________________________________ FileReporterTest.test_zipfile _______________________________________________________________________________
[gw27] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_filereporter.FileReporterTest object at 0x7fe125baeaf0>

    def test_zipfile(self) -> None:
        sys.path.append("tests/zip1.zip")

        # Test that we can get files out of zipfiles, and read their source files.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7f9287d30030>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7fd2a1ebbeb0>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7fcc8662a130>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7f1c8b689930>('# Oh noes!')

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
>           assert stderr.count("# Oh noes!") == 1
E           assert 0 == 1
E            +  where 0 = <built-in method count of str object at 0x7f1a96eaeab0>('# Oh noes!')

        For each morf in `morfs`, if it should be reported on (based on the omit
        and include configuration options), yield a pair, the `FileReporter` and
        `Analysis` for the morf.

        """
        file_reporters = coverage._get_file_reporters(morfs)
        config = coverage.config

        if config.report_include:
            matcher = GlobMatcher(prep_patterns(config.report_include), "report_include")
            file_reporters = [fr for fr in file_reporters if matcher.match(fr.filename)]

        if config.report_omit:
            matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit")
            file_reporters = [fr for fr in file_reporters if not matcher.match(fr.filename)]

        if not file_reporters:
>           raise NoDataError("No data to report.")

        For each morf in `morfs`, if it should be reported on (based on the omit
        and include configuration options), yield a pair, the `FileReporter` and
        `Analysis` for the morf.

        """
        file_reporters = coverage._get_file_reporters(morfs)
        config = coverage.config

        if config.report_include:
            matcher = GlobMatcher(prep_patterns(config.report_include), "report_include")
            file_reporters = [fr for fr in file_reporters if matcher.match(fr.filename)]

        if config.report_omit:
            matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit")
            file_reporters = [fr for fr in file_reporters if not matcher.match(fr.filename)]

        if not file_reporters:
>           raise NoDataError("No data to report.")

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

        For each morf in `morfs`, if it should be reported on (based on the omit
        and include configuration options), yield a pair, the `FileReporter` and
        `Analysis` for the morf.

        """
        file_reporters = coverage._get_file_reporters(morfs)
        config = coverage.config

        if config.report_include:
            matcher = GlobMatcher(prep_patterns(config.report_include), "report_include")
            file_reporters = [fr for fr in file_reporters if matcher.match(fr.filename)]

        if config.report_omit:
            matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit")
            file_reporters = [fr for fr in file_reporters if not matcher.match(fr.filename)]

        if not file_reporters:
>           raise NoDataError("No data to report.")

        The plugin will be disabled, and we check that a warning is output
        explaining why.

        """
        with pytest.warns(Warning) as warns:
            self.run_plugin(module_name)

        stderr = self.stderr()
        stderr += "".join(str(w.message) for w in warns)
        if our_error:
            # The exception we're causing should only appear once.
            assert stderr.count("# Oh noes!") == 1

        # There should be a warning explaining what's happening, but only one.

E           coverage.exceptions.NoSource: No source for code: '/src/try_ABC.zz'.

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/coverage/python.py:63: NoSource
________________________________________________________________________ GoodFileTracerTest.test_plugin2_with_branch ________________________________________________________________________
[gw12] linux -- Python 3.8.16 /usr/bin/python3

self = <coverage.parser.ByteParser object at 0x7f4aca58a700>, text = 'line 0\nline 1\nline 2\nline 3\nline 4\nline 5\nline 6\n', code = None
filename = '/tmp/pytest-of-tkloczko/pytest-13/popen-gw12/t11/foo_7.html'

    def __init__(
        self,
        text: str,
        code: Optional[CodeType] = None,
        filename: Optional[str] = None,
    ) -> None:
        self.text = text
        if code is not None:
            self.code = code
        else:
            assert filename is not None
            try:
>               self.code = compile(text, filename, "exec", dont_inherit=True)
E                 File "/tmp/pytest-of-tkloczko/pytest-13/popen-gw12/t11/foo_7.html", line 1
E                   line 0
E                        ^
E               SyntaxError: invalid syntax

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/coverage/parser.py:388: SyntaxError

The above exception was the direct cause of the following exception:

self = <tests.test_plugins.GoodFileTracerTest object at 0x7f4aca65fbb0>

    def test_plugin2_with_branch(self) -> None:
        self.make_render_and_caller()

        cov = coverage.Coverage(branch=True, omit=["*quux*"])
        CheckUniqueFilenames.hook(cov, '_should_trace')
        CheckUniqueFilenames.hook(cov, '_check_include_omit_etc')
        cov.set_option("run:plugins", ["tests.plugin2"])

        self.start_import_stop(cov, "caller")

        # The way plugin2 works, a file named foo_7.html will be claimed to
        # have 7 lines in it.

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

         Here we import os and
        # then check how many lines are measured.
        self.make_file("getenv.py", """\
            import os
            print("FOOEY == %s" % os.getenv("FOOEY"))
            """)

        fullcov = os.path.join(os.path.dirname(coverage.__file__), "fullcoverage")
        self.set_environ("FOOEY", "BOO")
        self.set_environ("PYTHONPATH", fullcov)
        out = self.run_command("python -X frozen_modules=off -m coverage run -L getenv.py")
>       assert out == "FOOEY == BOO\n"
E       AssertionError: assert '/usr/bin/pyt...ed coverage\n' == 'FOOEY == BOO\n'
E         - FOOEY == BOO
E         + /usr/bin/python3: No module named coverage

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/tests/test_process.py:574: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
/usr/bin/python3: No module named coverage

________________________________________________________ ProcessStartupWithSourceTest.test_pth_and_source_work_together[main-pkg--m] ________________________________________________________
[gw43] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.ProcessStartupWithSourceTest object at 0x7f3869da4310>, dashm = '-m', package = 'pkg', source = 'main'

    @pytest.mark.parametrize("dashm", ["-m", ""])
    @pytest.mark.parametrize("package", ["pkg", ""])
    @pytest.mark.parametrize("source", ["main", "sub"])
    def test_pth_and_source_work_together(self, dashm: str, package: str, source: str) -> None:
        """Run the test for a particular combination of factors.

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

          Create the data file here with bogus data in
        # it.
        data = coverage.CoverageData(".mycovdata")
        data.add_lines({os.path.abspath('sub.py'): range(100)})
        data.write()

        self.make_file("coverage.ini", """\
            [run]
            data_file = .mycovdata
            """)
        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")
        import main             # pylint: disable=unused-import, import-error

        with open("out.txt") as f:
            assert f.read() == "Hello, world!\n"

        # Read the data from .coverage
        self.assert_exists(".mycovdata")
        data = coverage.CoverageData(".mycovdata")
        data.read()
>       assert line_counts(data)['sub.py'] == 3
E       assert 100 == 3

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/tests/test_process.py:1170: AssertionError
_____________________________________________________________________ EnvironmentTest.test_coverage_zip_is_like_python ______________________________________________________________________
[gw46] linux -- Python 3.8.16 /usr/bin/python3

self = <tests.test_process.EnvironmentTest object at 0x7fb948a18280>

    def test_coverage_zip_is_like_python(self) -> None:
        # Test running coverage from a zip file itself.

        """
        # First, is this even credible try_execfile.py output?
>       assert '"DATA": "xyzzy"' in actual
E       assert '"DATA": "xyzzy"' in "python3: can't open file '/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/tests/covmain.zip': [Errno 2] No such file or directory\n"

/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/tests/test_process.py:673: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
{
    "DATA": "xyzzy",
    "FN_VAL": "my_fn('fooey')",
    "__builtins__.dir": [
        "ArithmeticError AssertionError AttributeError BaseException BlockingIOError BrokenPipeError BufferError BytesWarning ChildProcessError ConnectionAbortedError ConnectionError ConnectionRefusedError ConnectionResetError",
        "DeprecationWarning EOFError Ellipsis EnvironmentError Exception False FileExistsError FileNotFoundError FloatingPointError FutureWarning",
        "GeneratorExit IOError ImportError ImportWarning IndentationError IndexError InterruptedError IsADirectoryError",
        "KeyError KeyboardInterrupt LookupError MemoryError ModuleNotFoundError NameError None NotADirectoryError NotImplemented NotImplementedError",
        "OSError OverflowError PendingDeprecationWarning PermissionError ProcessLookupError RecursionError ReferenceError ResourceWarning RuntimeError RuntimeWarning",
        "StopAsyncIteration StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TimeoutError True TypeError",
        "UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning",
        "ValueError Warning ZeroDivisionError __build_class__ __debug__ __doc__ __import__ __loader__ __name__ __package__ __spec__",
        "abs all any ascii bin bool breakpoint bytearray bytes",
        "callable chr classmethod compile complex copyright credits delattr dict dir divmod",
        "enumerate eval exec exit filter float format frozenset getattr globals",
        "hasattr hash help hex id input int isinstance issubclass iter",
        "len license list locals map max memoryview min next object oct open ord",
        "pow print property quit range repr reversed round",
        "set setattr slice sorted staticmethod str sum super tuple type vars zip"
    ],
    "__builtins__.has_open": true,
    "__doc__": "Test file for run_python_file.\n\nThis file is executed two ways::\n\n    $ coverage run try_execfile.py\n\nand::\n\n    $ python try_execfile.py\n\nThe output is compared to see that the program execution context is the same\nunder coverage and under Python.\n\nIt is not crucial that the execution be identical, there are some differences\nthat are OK.

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

        The arguments are all strings:

        * `dashm`: Either "" (run the program as a file) or "-m" (run the
          program as a module).

        * `package`: Either "" (put the source at the top level) or a
          package name to use to hold the source.

        * `source`: Either "main" or "sub", which file to use as the
          ``--source`` argument.

        """
        def fullname(modname: str) -> str:
            """What is the full module name for `modname` for this test?"""
            if package and dashm:
                return '.'.join((package, modname))
            else:
                return modname

        def path(basename: str) -> str:
            """Where should `basename` be created for this test?"""
            return os.path.join(package, basename)

        # Main will run sub.py.
        self.make_file(path("main.py"), """\
            import %s
            a = 2
            b = 3
            """ % fullname('sub'))
        if package:
            self.make_file(path("__init__.py"), "")
        # sub.py will write a few lines.
        self.make_file(path("sub.py"), """\
            f = open("out.txt", "w")
            f.write("Hello, world!")
            f.close()
            """)
        self.make_file("coverage.ini", """\
            [run]
            source = %s
            """ % fullname(source))

        self.set_environ("COVERAGE_PROCESS_START", "coverage.ini")

        if dashm:
            cmd = "python -m %s" % fullname('main')
        else:
            cmd = "python %s" % path('main.py')

        self.run_command(cmd)

        with open("out.txt") as f:
            assert f.read() == "Hello, world!"

SKIPPED [2] tests/test_concurrency.py:229: Can't test: Couldn't trace with concurrency=gevent, the module isn't installed.
SKIPPED [3] tests/test_concurrency.py:229: Can't test: Couldn't trace with concurrency=eventlet, the module isn't installed.
SKIPPED [2] tests/test_concurrency.py:229: Can't test: Couldn't trace with concurrency=greenlet, the module isn't installed.
SKIPPED [2] tests/test_concurrency.py:481: Can't test: Couldn't trace with concurrency=eventlet, the module isn't installed.
SKIPPED [1] tests/test_files.py:579: This test assumes Windows file system
SKIPPED [1] tests/test_files.py:691: Only need to run Windows tests on Windows.
SKIPPED [1] tests/test_oddball.py:210: This is too expensive for now (30s)
SKIPPED [1] tests/test_parser.py:435: Match-case is new in 3.10
SKIPPED [1] tests/test_phystokens.py:119: Soft keywords are new in Python 3.10
SKIPPED [1] tests/test_plugins.py:278: This test is only about PyTracer.
SKIPPED [1] tests/test_python.py:53: not windows
SKIPPED [1] tests/test_summary.py:734: .pyw files are only on Windows.
XFAIL tests/test_arcs.py::LoopArcTest::test_incorrect_if_bug_1175 - <3.10 traced final pass incorrectly
XFAIL tests/test_arcs.py::LoopArcTest::test_incorrect_loop_exit_bug_1175 - <3.10 traced final pass incorrectly
ERROR tests/test_venv.py::VirtualenvTest::test_third_party_venv_isnt_measured[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_third_party_venv_isnt_measured[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_us_in_venv_isnt_measured[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_us_in_venv_isnt_measured[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_isnt_measured[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_isnt_measured[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_with_dynamic_plugin[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_venv_with_dynamic_plugin[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_installed_namespace_packages[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_installed_namespace_packages[python -m coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_bug_888[coverage] - assert 127 == 0
ERROR tests/test_venv.py::VirtualenvTest::test_bug_888[python -m coverage] - assert 127 == 0
FAILED tests/test_cmdline.py::CmdLineStdoutTest::test_version - AssertionError: assert 'with C extension' in 'Coverage.py, version 7.2.1 without C extension\nFull documentation is at https://coverage.readthedocs.io/en/7.2.1\n'
FAILED tests/test_debug.py::DebugTraceTest::test_debug_sys_ctracer - AssertionError: assert 'CTracer: available' == 'CTracer: unavailable'
FAILED tests/test_filereporter.py::FileReporterTest::test_zipfile - ModuleNotFoundError: No module named 'zip1'
FAILED tests/test_plugins.py::PluginTest::test_plugin_sys_info - AssertionError: assert 'plugins.file_tracers: plugin_sys_info.Plugin' in ['-- sys -------------------------------------------------------', 'coverage_version: 7.2.1', 'coverage_module:...
FAILED tests/test_plugins.py::GoodFileTracerTest::test_find_unexecuted - assert [1] == [99, 999, 9999]
FAILED tests/test_plugins.py::BadFileTracerTest::test_plugin_has_inherited_filereporter_method - Failed: DID NOT RAISE <class 'NotImplementedError'>
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_fails - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_fails_eventually - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_has_dynamic_source_filename_fails - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_returns_triple - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_returns_wrong - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_source_filename_returns_wrong - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_source_filename_fails - assert 0 == 1
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_returns_non_tuple - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_raises_error - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_has_no_file_tracer_method - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::BadFileTracerTest::test_dynamic_source_filename_fails - assert 0 == 1
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_text_report - coverage.exceptions.NoDataError: No data to report.
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_xml_report - coverage.exceptions.NoDataError: No data to report.
FAILED tests/test_plugins.py::BadFileTracerTest::test_line_number_range_returns_pair_of_strings - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_html_report - coverage.exceptions.NoDataError: No data to report.
FAILED tests/test_plugins.py::BadFileTracerTest::test_file_tracer_has_inherited_sourcefilename_method - assert "Disabling plug-in 'bad_plugin.Plugin' due to " in "Plugin file tracers (bad_plugin.Plugin) aren't supported with PyTracer"
FAILED tests/test_plugins.py::GoodFileTracerTest::test_defer_to_python - AssertionError: assert ['Name       ...    3    50%'] == ['Name       ...    0   100%']
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin1 - coverage.exceptions.NoSource: No source for code: '/src/try_ABC.zz'.
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2_with_branch - coverage.exceptions.NotPython: Couldn't parse '/tmp/pytest-of-tkloczko/pytest-13/popen-gw12/t11/foo_7.html' as Python source: 'invalid syntax' at line 1
FAILED tests/test_plugins.py::GoodFileTracerTest::test_plugin2 - coverage.exceptions.NotPython: Couldn't parse '/tmp/pytest-of-tkloczko/pytest-13/popen-gw1/t16/foo_7.html' as Python source: 'invalid syntax' at line 1
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[utf-8] - assert None is not None
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[gb2312] - assert None is not None
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[hebrew] - assert None is not None
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[shift_jis] - assert None is not None
FAILED tests/test_python.py::GetZipBytesTest::test_get_encoded_zip_files[cp1252] - assert None is not None
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub-pkg-] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessTest::test_tests_dir_is_importable - assert "Traceback (m...covmodzip1'\n" == 'done\n'
FAILED tests/test_process.py::ProcessTest::test_fullcoverage - AssertionError: assert '/usr/bin/pyt...ed coverage\n' == 'FOOEY == BOO\n'
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main-pkg--m] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub--] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupTest::test_subprocess_with_pth_files - assert 100 == 3
FAILED tests/test_process.py::EnvironmentTest::test_coverage_zip_is_like_python - assert '"DATA": "xyzzy"' in "python3: can't open file '/home/tkloczko/rpmbuild/BUILD/coveragepy-7.2.1/tests/covmain.zip': [Errno 2] No such file or directory\n"
FAILED tests/test_summary.py::SummaryTest::test_report_just_one - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main---m] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub-pkg--m] - AssertionError: File '.coverage' should exist
FAILED tests/test_summary.py::SummaryTest::test_report_including - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_process.py::ProcessStartupTest::test_subprocess_with_pth_files_and_parallel - KeyError: 'sub.py'
FAILED tests/test_testing.py::test_xdist_sys_path_nuttiness_is_fixed - AssertionError: assert '/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.2.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.2.1-...
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main-pkg-] - AssertionError: File '.coverage' should exist
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[main--] - AssertionError: File '.coverage' should exist
FAILED tests/test_summary.py::SummaryTest::test_report - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_summary.py::SummaryTest::test_report_omitting - ModuleNotFoundError: No module named 'covmodzip1'
FAILED tests/test_summary.py::SummaryTest::test_report_wildcard - AssertionError: assert 'TOTAL 4 2 50%' == 'TOTAL 4 0 100%'
FAILED tests/test_process.py::ProcessStartupWithSourceTest::test_pth_and_source_work_together[sub---m] - AssertionError: File '.coverage' should exist
50 failed, 1241 passed, 22 skipped, 2 xfailed, 9 warnings, 12 errors in 15.72s

Looks like python -m foo still is in use.

Here is propose of the patch whci replaces use python by use sys.executable or <module_wrapper_script> instead python -m module if such script exist.
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -653,7 +653,7 @@
         # module, like it used to:
         #   $ python -m coverage
         #   Code coverage for Python.  Use '__main__.py help' for help.
-        out = self.run_command("python -m coverage")
+        out = self.run_command("coverage")
         assert "Use 'coverage help' for help" in out

@@ -676,7 +676,7 @@
     def test_coverage_run_is_like_python(self) -> None:
         with open(TRY_EXECFILE) as f:
             self.make_file("run_me.py", f.read())
-        expected = self.run_command("python run_me.py")
+        expected = self.run_command(sys.executable, "run_me.py")
         actual = self.run_command("coverage run run_me.py")
         self.assert_tryexecfile_output(expected, actual)

@@ -689,7 +689,7 @@

     def test_coverage_run_dashm_is_like_python_dashm(self) -> None:
         # These -m commands assume the coverage tree is on the path.
-        expected = self.run_command("python -m process_test.try_execfile")
+        expected = self.run_command(sys.executable, "-m process_test.try_execfile")
         actual = self.run_command("coverage run -m process_test.try_execfile")
         self.assert_tryexecfile_output(expected, actual)

@@ -705,7 +705,7 @@
         with open(TRY_EXECFILE) as f:
             self.make_file("with_main/__main__.py", f.read())

-        expected = self.run_command("python -m with_main")
+        expected = self.run_command(sys.executable, "-m with_main")
         actual = self.run_command("coverage run -m with_main")
         self.assert_tryexecfile_output(expected, actual)

@@ -714,7 +714,7 @@
             self.make_file("with_main/__main__.py", f.read())
         self.make_file("with_main/__init__.py", "")

-        expected = self.run_command("python -m with_main")
+        expected = self.run_command(sys.executable, "-m with_main")
         actual = self.run_command("coverage run -m with_main")
         self.assert_tryexecfile_output(expected, actual)

@@ -725,7 +725,7 @@
         --source machinery to know and respect the original name.
         """
         # These -m commands assume the coverage tree is on the path.
-        expected = self.run_command("python -m process_test.try_execfile")
+        expected = self.run_command(sys.executable "-m process_test.try_execfile")
         actual = self.run_command(
             "coverage run --source process_test.try_execfile -m process_test.try_execfile"
         )
@@ -745,7 +745,7 @@
             disable_warnings = module-not-measured
             """)
         # These -m commands assume the coverage tree is on the path.
-        expected = self.run_command("python -m process_test.try_execfile")
+        expected = self.run_command(sys.executable "-m process_test.try_execfile")
         actual = self.run_command(
             "coverage run --source process_test -m process_test.try_execfile"
         )
@@ -780,7 +780,7 @@
         with open(TRY_EXECFILE) as f:
             self.make_file("sub/run_me.py", f.read())

-        expected = self.run_command("python -m sub.run_me")
+        expected = self.run_command(sys.executable, "-m sub.run_me")
         actual = self.run_command("coverage run -m sub.run_me")
         self.assert_tryexecfile_output(expected, actual)

@@ -788,7 +788,7 @@
         # https://github.com/nedbat/coveragepy/issues/207
         self.make_file("package/__init__.py", "print('init')")
         self.make_file("package/__main__.py", "print('main')")
-        expected = self.run_command("python -m package")
+        expected = self.run_command(sys.executable, "-m package")
         actual = self.run_command("coverage run -m package")
         assert expected == actual

@@ -830,10 +830,10 @@
             print(thing.SOMETHING)
             """)
         # If this test fails, it will be with "can't import thing".
-        out = self.run_command("python run_coverage.py run how_is_it.py")
+        out = self.run_command(sys.executable, "run_coverage.py run how_is_it.py")
         assert "hello-xyzzy" in out

-        out = self.run_command("python -m run_coverage run how_is_it.py")
+        out = self.run_command(sys.executable, "-m run_coverage run how_is_it.py")
         assert "hello-xyzzy" in out

     @pytest.mark.skipif(env.WINDOWS, reason="Windows can't make symlinks")
@@ -1003,7 +1003,7 @@
     def assert_pydoc_ok(self, name: str, thing: Any) -> None:
         """Check that pydoc of `name` finds the docstring from `thing`."""
         # Run pydoc.
-        out = self.run_command("python -m pydoc " + name)
+        out = self.run_command("pydoc " + name)
         # It should say "Help on..", and not have a traceback
         assert out.startswith("Help on ")
         assert "Traceback" not in out

pytest output with above patch

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.2.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coverage-7.2.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
bringing up nodes...
............................................................................................................................................s......s.s.s.......................x..x..... [ 14%]
..............................................................F..........................................................................................................s..s..sss...s.. [ 29%]
.s.s........s.................s...................................................................................................................................................... [ 43%]
...................................F...................................F................................................................................................................ [ 57%]
......................................................s......................s......................................................................................................... [ 72%]
..............s...............F...s............s.....s..............F..F.......FF...sF...FF...F.F.FFFFF..FFFF....F.......F.F.F..............F..F.....F............F.s......F..F......F [ 87%]
.F..............F...............F......F................................E.........E...E.E....E...E................EE...........E...E....EE...........F.........                       [100%]