pytest-dev / pytest-cov

Coverage plugin for pytest.
MIT License
1.72k stars 211 forks source link

Tests fails with coverage 6.5.0 #570

Open danigm opened 1 year ago

danigm commented 1 year ago

Summary

test_contexts fails with the latest release of coverage == 6.5.0.

Versions

A tox run is visible in my fork: https://github.com/danigm/pytest-cov/actions/runs/3563407946/jobs/5986157416

This is the output:

=================================== FAILURES ===================================
____________________________ test_contexts[nodist] _____________________________

pytester = <Pytester PosixPath('/tmp/pytest-of-runner/pytest-0/test_contexts0')>
testdir = <Testdir local('/tmp/pytest-of-runner/pytest-0/test_contexts0')>
opts = ''

    @pytest.mark.skipif("coverage.version_info < (5, 0)")
    @xdist_params
    def test_contexts(pytester, testdir, opts):
        with open(os.path.join(os.path.dirname(__file__), "contextful.py")) as f:
            contextful_tests = f.read()
        script = testdir.makepyfile(contextful_tests)
        result = testdir.runpytest('-v',
                                   '--cov=%s' % script.dirpath(),
                                   '--cov-context=test',
                                   script,
                                   *opts.split()
                                   )
        assert result.ret == 0
        result.stdout.fnmatch_lines([
            'test_contexts* 100%*',
        ])

        data = coverage.CoverageData(".coverage")
        data.read()
>       assert data.measured_contexts() == set(EXPECTED_CONTEXTS)
E       AssertionError: assert {'',\n 'test_contexts.py::OldStyleTests::test_03|run',\n 'test_contexts.py::OldStyleTests::test_03|setup',\n 'test_contexts.py::OldStyleTests::test_03|teardown',\n 'test_contexts.py::OldStyleTests::test_04|run',\n 'test_contexts.py::OldStyleTests::test_04|setup',\n 'test_contexts.py::OldStyleTests::test_04|teardown',\n 'test_contexts.py::test_01|run',\n 'test_contexts.py::test_01|setup',\n 'test_contexts.py::test_01|teardown',\n 'test_contexts.py::test_02|run',\n 'test_contexts.py::test_02|setup',\n 'test_contexts.py::test_02|teardown',\n 'test_contexts.py::test_05|run',\n 'test_contexts.py::test_05|setup',\n 'test_contexts.py::test_05|teardown',\n 'test_contexts.py::test_06|run',\n 'test_contexts.py::test_06|setup',\n 'test_contexts.py::test_06|teardown',\n 'test_contexts.py::test_07|run',\n 'test_contexts.py::test_07|setup',\n 'test_contexts.py::test_07|teardown',\n 'test_contexts.py::test_08|run',\n 'test_contexts.py::test_08|setup',\n 'test_contexts.py::test_08|teardown',\n 'test_contexts.py::test_09[1]|run',\n 'test_contexts.py::test_09[1]|setup',\n 'test_contexts.py::test_09[1]|teardown',\n 'test_contexts.py::test_09[2]|run',\n 'test_contexts.py::test_09[2]|setup',\n 'test_contexts.py::test_09[2]|teardown',\n 'test_contexts.py::test_09[3]|run',\n 'test_contexts.py::test_09[3]|setup',\n 'test_contexts.py::test_09[3]|teardown',\n 'test_contexts.py::test_10|run',\n 'test_contexts.py::test_10|setup',\n 'test_contexts.py::test_10|teardown',\n 'test_contexts.py::test_11[1-101]|run',\n 'test_contexts.py::test_11[1-101]|setup',\n 'test_contexts.py::test_11[1-101]|teardown',\n 'test_contexts.py::test_11[2-202]|run',\n 'test_contexts.py::test_11[2-202]|setup',\n 'test_contexts.py::test_11[2-202]|teardown',\n 'test_contexts.py::test_12[one]|run',\n 'test_contexts.py::test_12[one]|setup',\n 'test_contexts.py::test_12[one]|teardown',\n 'test_contexts.py::test_12[two]|run',\n 'test_contexts.py::test_12[two]|setup',\n 'test_contexts.py::test_12[two]|teardown',\n 'test_contexts.py::test_13[3-1]|run',\n 'test_contexts.py::test_13[3-1]|setup',\n 'test_contexts.py::test_13[3-1]|teardown',\n 'test_contexts.py::test_13[3-2]|run',\n 'test_contexts.py::test_13[3-2]|setup',\n 'test_contexts.py::test_13[3-2]|teardown',\n 'test_contexts.py::test_13[4-1]|run',\n 'test_contexts.py::test_13[4-1]|setup',\n 'test_contexts.py::test_13[4-1]|teardown',\n 'test_contexts.py::test_13[4-2]|run',\n 'test_contexts.py::test_13[4-2]|setup',\n 'test_contexts.py::test_13[4-2]|teardown'} == {'',\n 'test_contexts.py::OldStyleTests::test_03|run',\n 'test_contexts.py::OldStyleTests::test_03|setup',\n 'test_contexts.py::OldStyleTests::test_04|run',\n 'test_contexts.py::OldStyleTests::test_04|teardown',\n 'test_contexts.py::test_01|run',\n 'test_contexts.py::test_02|run',\n 'test_contexts.py::test_05|run',\n 'test_contexts.py::test_05|setup',\n 'test_contexts.py::test_06|run',\n 'test_contexts.py::test_06|setup',\n 'test_contexts.py::test_07|run',\n 'test_contexts.py::test_07|setup',\n 'test_contexts.py::test_08|run',\n 'test_contexts.py::test_09[1]|run',\n 'test_contexts.py::test_09[1]|setup',\n 'test_contexts.py::test_09[2]|run',\n 'test_contexts.py::test_09[2]|setup',\n 'test_contexts.py::test_09[3]|run',\n 'test_contexts.py::test_09[3]|setup',\n 'test_contexts.py::test_10|run',\n 'test_contexts.py::test_11[1-101]|run',\n 'test_contexts.py::test_11[2-202]|run',\n 'test_contexts.py::test_12[one]|run',\n 'test_contexts.py::test_12[two]|run',\n 'test_contexts.py::test_13[3-1]|run',\n 'test_contexts.py::test_13[3-2]|run',\n 'test_contexts.py::test_13[4-1]|run',\n 'test_contexts.py::test_13[4-2]|run'}
E         Extra items in the left set:
E         'test_contexts.py::test_02|setup'
E         'test_contexts.py::test_09[1]|teardown'
E         'test_contexts.py::test_12[two]|setup'
E         'test_contexts.py::test_11[1-101]|teardown'
E         'test_contexts.py::test_13[4-2]|teardown'
E         'test_contexts.py::test_08|setup'
E         'test_contexts.py::test_13[4-1]|setup'
E         'test_contexts.py::test_06|teardown'
E         'test_contexts.py::test_11[2-202]|teardown'
E         'test_contexts.py::test_13[3-2]|teardown'
E         'test_contexts.py::test_01|teardown'
E         'test_contexts.py::test_10|teardown'
E         'test_contexts.py::test_12[two]|teardown'
E         'test_contexts.py::test_09[3]|teardown'
E         'test_contexts.py::OldStyleTests::test_03|teardown'
E         'test_contexts.py::test_12[one]|setup'
E         'test_contexts.py::test_11[1-101]|setup'
E         'test_contexts.py::test_01|setup'
E         'test_contexts.py::test_13[3-1]|teardown'
E         'test_contexts.py::test_13[4-1]|teardown'
E         'test_contexts.py::OldStyleTests::test_04|setup'
E         'test_contexts.py::test_13[3-2]|setup'
E         'test_contexts.py::test_09[2]|teardown'
E         'test_contexts.py::test_10|setup'
E         'test_contexts.py::test_07|teardown'
E         'test_contexts.py::test_13[3-1]|setup'
E         'test_contexts.py::test_11[2-202]|setup'
E         'test_contexts.py::test_05|teardown'
E         'test_contexts.py::test_08|teardown'
E         'test_contexts.py::test_12[one]|teardown'
E         'test_contexts.py::test_13[4-2]|setup'
E         'test_contexts.py::test_02|teardown'
E         Full diff:
E           {
E            '',
E            'test_contexts.py::OldStyleTests::test_03|run',
E            'test_contexts.py::OldStyleTests::test_03|setup',
E         +  'test_contexts.py::OldStyleTests::test_03|teardown',
E            'test_contexts.py::OldStyleTests::test_04|run',
E         +  'test_contexts.py::OldStyleTests::test_04|setup',
E            'test_contexts.py::OldStyleTests::test_04|teardown',
E            'test_contexts.py::test_01|run',
E         +  'test_contexts.py::test_01|setup',
E         +  'test_contexts.py::test_01|teardown',
E            'test_contexts.py::test_02|run',
E         +  'test_contexts.py::test_02|setup',
E         +  'test_contexts.py::test_02|teardown',
E            'test_contexts.py::test_05|run',
E            'test_contexts.py::test_05|setup',
E         +  'test_contexts.py::test_05|teardown',
E            'test_contexts.py::test_06|run',
E            'test_contexts.py::test_06|setup',
E         +  'test_contexts.py::test_06|teardown',
E            'test_contexts.py::test_07|run',
E            'test_contexts.py::test_07|setup',
E         +  'test_contexts.py::test_07|teardown',
E            'test_contexts.py::test_08|run',
E         +  'test_contexts.py::test_08|setup',
E         +  'test_contexts.py::test_08|teardown',
E            'test_contexts.py::test_09[1]|run',
E            'test_contexts.py::test_09[1]|setup',
E         +  'test_contexts.py::test_09[1]|teardown',
E            'test_contexts.py::test_09[2]|run',
E            'test_contexts.py::test_09[2]|setup',
E         +  'test_contexts.py::test_09[2]|teardown',
E            'test_contexts.py::test_09[3]|run',
E            'test_contexts.py::test_09[3]|setup',
E         +  'test_contexts.py::test_09[3]|teardown',
E            'test_contexts.py::test_10|run',
E         +  'test_contexts.py::test_10|setup',
E         +  'test_contexts.py::test_10|teardown',
E            'test_contexts.py::test_11[1-101]|run',
E         +  'test_contexts.py::test_11[1-101]|setup',
E         +  'test_contexts.py::test_11[1-101]|teardown',
E            'test_contexts.py::test_11[2-202]|run',
E         +  'test_contexts.py::test_11[2-202]|setup',
E         +  'test_contexts.py::test_11[2-202]|teardown',
E            'test_contexts.py::test_12[one]|run',
E         +  'test_contexts.py::test_12[one]|setup',
E         +  'test_contexts.py::test_12[one]|teardown',
E            'test_contexts.py::test_12[two]|run',
E         +  'test_contexts.py::test_12[two]|setup',
E         +  'test_contexts.py::test_12[two]|teardown',
E            'test_contexts.py::test_13[3-1]|run',
E         +  'test_contexts.py::test_13[3-1]|setup',
E         +  'test_contexts.py::test_13[3-1]|teardown',
E            'test_contexts.py::test_13[3-2]|run',
E         +  'test_contexts.py::test_13[3-2]|setup',
E         +  'test_contexts.py::test_13[3-2]|teardown',
E            'test_contexts.py::test_13[4-1]|run',
E         +  'test_contexts.py::test_13[4-1]|setup',
E         +  'test_contexts.py::test_13[4-1]|teardown',
E            'test_contexts.py::test_13[4-2]|run',
E         +  'test_contexts.py::test_13[4-2]|setup',
E         +  'test_contexts.py::test_13[4-2]|teardown',
E           }

/home/runner/work/pytest-cov/pytest-cov/tests/test_pytest_cov.py:1937: AssertionError
----------------------------- Captured stdout call -----------------------------
running: /home/runner/work/pytest-cov/pytest-cov/.tox/py310-pytest71-xdist250-coverage65/bin/python -mpytest --basetemp=/tmp/pytest-of-runner/pytest-0/test_contexts0/runpytest-0 -v --cov=/tmp/pytest-of-runner/pytest-0/test_contexts0 --cov-context=test /tmp/pytest-of-runner/pytest-0/test_contexts0/test_contexts.py --basetemp=/tmp/pytest-of-runner/pytest-0/basetemp
     in: /tmp/pytest-of-runner/pytest-0/test_contexts0
============================= test session starts ==============================
platform linux -- Python 3.10.8, pytest-7.1.2, pluggy-1.0.0 -- /home/runner/work/pytest-cov/pytest-cov/.tox/py310-pytest71-xdist250-coverage65/bin/python
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-runner/pytest-0/test_contexts0
plugins: forked-1.4.0, xdist-2.5.0, cov-4.0.0
collecting ... collected 20 items

test_contexts.py::test_01 PASSED                                         [  5%]
test_contexts.py::test_02 PASSED                                         [ 10%]
test_contexts.py::OldStyleTests::test_03 PASSED                          [ 15%]
test_contexts.py::OldStyleTests::test_04 PASSED                          [ 20%]
test_contexts.py::test_05 PASSED                                         [ 25%]
test_contexts.py::test_06 PASSED                                         [ 30%]
test_contexts.py::test_07 PASSED                                         [ 35%]
test_contexts.py::test_08 PASSED                                         [ 40%]
test_contexts.py::test_09[1] PASSED                                      [ 45%]
test_contexts.py::test_09[2] PASSED                                      [ 50%]
test_contexts.py::test_09[3] PASSED                                      [ 55%]
test_contexts.py::test_10 PASSED                                         [ 60%]
test_contexts.py::test_11[1-101] PASSED                                  [ 65%]
test_contexts.py::test_11[2-202] PASSED                                  [ 70%]
test_contexts.py::test_12[one] PASSED                                    [ 75%]
test_contexts.py::test_12[two] PASSED                                    [ 80%]
test_contexts.py::test_13[3-1] PASSED                                    [ 85%]
test_contexts.py::test_13[3-2] PASSED                                    [ 90%]
test_contexts.py::test_13[4-1] PASSED                                    [ 95%]
test_contexts.py::test_13[4-2] PASSED                                    [100%]

---------- coverage: platform linux, python 3.10.8-final-0 -----------
Name               Stmts   Miss  Cover
--------------------------------------
test_contexts.py      58      0   100%
--------------------------------------
TOTAL                 58      0   100%

============================== 20 passed in 0.14s ==============================
_____________________________ test_contexts[xdist] _____________________________

pytester = <Pytester PosixPath('/tmp/pytest-of-runner/pytest-0/test_contexts1')>
testdir = <Testdir local('/tmp/pytest-of-runner/pytest-0/test_contexts1')>
opts = '-n 1'

    @pytest.mark.skipif("coverage.version_info < (5, 0)")
    @xdist_params
    def test_contexts(pytester, testdir, opts):
        with open(os.path.join(os.path.dirname(__file__), "contextful.py")) as f:
            contextful_tests = f.read()
        script = testdir.makepyfile(contextful_tests)
        result = testdir.runpytest('-v',
                                   '--cov=%s' % script.dirpath(),
                                   '--cov-context=test',
                                   script,
                                   *opts.split()
                                   )
        assert result.ret == 0
        result.stdout.fnmatch_lines([
            'test_contexts* 100%*',
        ])

        data = coverage.CoverageData(".coverage")
        data.read()
>       assert data.measured_contexts() == set(EXPECTED_CONTEXTS)
E       AssertionError: assert {'',\n 'test_contexts.py::OldStyleTests::test_03|run',\n 'test_contexts.py::OldStyleTests::test_03|setup',\n 'test_contexts.py::OldStyleTests::test_03|teardown',\n 'test_contexts.py::OldStyleTests::test_04|run',\n 'test_contexts.py::OldStyleTests::test_04|setup',\n 'test_contexts.py::OldStyleTests::test_04|teardown',\n 'test_contexts.py::test_01|run',\n 'test_contexts.py::test_01|setup',\n 'test_contexts.py::test_01|teardown',\n 'test_contexts.py::test_02|run',\n 'test_contexts.py::test_02|setup',\n 'test_contexts.py::test_02|teardown',\n 'test_contexts.py::test_05|run',\n 'test_contexts.py::test_05|setup',\n 'test_contexts.py::test_05|teardown',\n 'test_contexts.py::test_06|run',\n 'test_contexts.py::test_06|setup',\n 'test_contexts.py::test_06|teardown',\n 'test_contexts.py::test_07|run',\n 'test_contexts.py::test_07|setup',\n 'test_contexts.py::test_07|teardown',\n 'test_contexts.py::test_08|run',\n 'test_contexts.py::test_08|setup',\n 'test_contexts.py::test_08|teardown',\n 'test_contexts.py::test_09[1]|run',\n 'test_contexts.py::test_09[1]|setup',\n 'test_contexts.py::test_09[1]|teardown',\n 'test_contexts.py::test_09[2]|run',\n 'test_contexts.py::test_09[2]|setup',\n 'test_contexts.py::test_09[2]|teardown',\n 'test_contexts.py::test_09[3]|run',\n 'test_contexts.py::test_09[3]|setup',\n 'test_contexts.py::test_09[3]|teardown',\n 'test_contexts.py::test_10|run',\n 'test_contexts.py::test_10|setup',\n 'test_contexts.py::test_10|teardown',\n 'test_contexts.py::test_11[1-101]|run',\n 'test_contexts.py::test_11[1-101]|setup',\n 'test_contexts.py::test_11[1-101]|teardown',\n 'test_contexts.py::test_11[2-202]|run',\n 'test_contexts.py::test_11[2-202]|setup',\n 'test_contexts.py::test_11[2-202]|teardown',\n 'test_contexts.py::test_12[one]|run',\n 'test_contexts.py::test_12[one]|setup',\n 'test_contexts.py::test_12[one]|teardown',\n 'test_contexts.py::test_12[two]|run',\n 'test_contexts.py::test_12[two]|setup',\n 'test_contexts.py::test_12[two]|teardown',\n 'test_contexts.py::test_13[3-1]|run',\n 'test_contexts.py::test_13[3-1]|setup',\n 'test_contexts.py::test_13[3-1]|teardown',\n 'test_contexts.py::test_13[3-2]|run',\n 'test_contexts.py::test_13[3-2]|setup',\n 'test_contexts.py::test_13[3-2]|teardown',\n 'test_contexts.py::test_13[4-1]|run',\n 'test_contexts.py::test_13[4-1]|setup',\n 'test_contexts.py::test_13[4-1]|teardown',\n 'test_contexts.py::test_13[4-2]|run',\n 'test_contexts.py::test_13[4-2]|setup',\n 'test_contexts.py::test_13[4-2]|teardown'} == {'',\n 'test_contexts.py::OldStyleTests::test_03|run',\n 'test_contexts.py::OldStyleTests::test_03|setup',\n 'test_contexts.py::OldStyleTests::test_04|run',\n 'test_contexts.py::OldStyleTests::test_04|teardown',\n 'test_contexts.py::test_01|run',\n 'test_contexts.py::test_02|run',\n 'test_contexts.py::test_05|run',\n 'test_contexts.py::test_05|setup',\n 'test_contexts.py::test_06|run',\n 'test_contexts.py::test_06|setup',\n 'test_contexts.py::test_07|run',\n 'test_contexts.py::test_07|setup',\n 'test_contexts.py::test_08|run',\n 'test_contexts.py::test_09[1]|run',\n 'test_contexts.py::test_09[1]|setup',\n 'test_contexts.py::test_09[2]|run',\n 'test_contexts.py::test_09[2]|setup',\n 'test_contexts.py::test_09[3]|run',\n 'test_contexts.py::test_09[3]|setup',\n 'test_contexts.py::test_10|run',\n 'test_contexts.py::test_11[1-101]|run',\n 'test_contexts.py::test_11[2-202]|run',\n 'test_contexts.py::test_12[one]|run',\n 'test_contexts.py::test_12[two]|run',\n 'test_contexts.py::test_13[3-1]|run',\n 'test_contexts.py::test_13[3-2]|run',\n 'test_contexts.py::test_13[4-1]|run',\n 'test_contexts.py::test_13[4-2]|run'}
E         Extra items in the left set:
E         'test_contexts.py::test_02|setup'
E         'test_contexts.py::test_09[1]|teardown'
E         'test_contexts.py::test_12[two]|setup'
E         'test_contexts.py::test_11[1-101]|teardown'
E         'test_contexts.py::test_13[4-2]|teardown'
E         'test_contexts.py::test_08|setup'
E         'test_contexts.py::test_13[4-1]|setup'
E         'test_contexts.py::test_06|teardown'
E         'test_contexts.py::test_11[2-202]|teardown'
E         'test_contexts.py::test_13[3-2]|teardown'
E         'test_contexts.py::test_01|teardown'
E         'test_contexts.py::test_10|teardown'
E         'test_contexts.py::test_12[two]|teardown'
E         'test_contexts.py::test_09[3]|teardown'
E         'test_contexts.py::OldStyleTests::test_03|teardown'
E         'test_contexts.py::test_12[one]|setup'
E         'test_contexts.py::test_11[1-101]|setup'
E         'test_contexts.py::test_01|setup'
E         'test_contexts.py::test_13[3-1]|teardown'
E         'test_contexts.py::test_13[4-1]|teardown'
E         'test_contexts.py::OldStyleTests::test_04|setup'
E         'test_contexts.py::test_13[3-2]|setup'
E         'test_contexts.py::test_09[2]|teardown'
E         'test_contexts.py::test_10|setup'
E         'test_contexts.py::test_07|teardown'
E         'test_contexts.py::test_13[3-1]|setup'
E         'test_contexts.py::test_11[2-202]|setup'
E         'test_contexts.py::test_05|teardown'
E         'test_contexts.py::test_08|teardown'
E         'test_contexts.py::test_12[one]|teardown'
E         'test_contexts.py::test_13[4-2]|setup'
E         'test_contexts.py::test_02|teardown'
E         Full diff:
E           {
E            '',
E            'test_contexts.py::OldStyleTests::test_03|run',
E            'test_contexts.py::OldStyleTests::test_03|setup',
E         +  'test_contexts.py::OldStyleTests::test_03|teardown',
E            'test_contexts.py::OldStyleTests::test_04|run',
E         +  'test_contexts.py::OldStyleTests::test_04|setup',
E            'test_contexts.py::OldStyleTests::test_04|teardown',
E            'test_contexts.py::test_01|run',
E         +  'test_contexts.py::test_01|setup',
E         +  'test_contexts.py::test_01|teardown',
E            'test_contexts.py::test_02|run',
E         +  'test_contexts.py::test_02|setup',
E         +  'test_contexts.py::test_02|teardown',
E            'test_contexts.py::test_05|run',
E            'test_contexts.py::test_05|setup',
E         +  'test_contexts.py::test_05|teardown',
E            'test_contexts.py::test_06|run',
E            'test_contexts.py::test_06|setup',
E         +  'test_contexts.py::test_06|teardown',
E            'test_contexts.py::test_07|run',
E            'test_contexts.py::test_07|setup',
E         +  'test_contexts.py::test_07|teardown',
E            'test_contexts.py::test_08|run',
E         +  'test_contexts.py::test_08|setup',
E         +  'test_contexts.py::test_08|teardown',
E            'test_contexts.py::test_09[1]|run',
E            'test_contexts.py::test_09[1]|setup',
E         +  'test_contexts.py::test_09[1]|teardown',
E            'test_contexts.py::test_09[2]|run',
E            'test_contexts.py::test_09[2]|setup',
E         +  'test_contexts.py::test_09[2]|teardown',
E            'test_contexts.py::test_09[3]|run',
E            'test_contexts.py::test_09[3]|setup',
E         +  'test_contexts.py::test_09[3]|teardown',
E            'test_contexts.py::test_10|run',
E         +  'test_contexts.py::test_10|setup',
E         +  'test_contexts.py::test_10|teardown',
E            'test_contexts.py::test_11[1-101]|run',
E         +  'test_contexts.py::test_11[1-101]|setup',
E         +  'test_contexts.py::test_11[1-101]|teardown',
E            'test_contexts.py::test_11[2-202]|run',
E         +  'test_contexts.py::test_11[2-202]|setup',
E         +  'test_contexts.py::test_11[2-202]|teardown',
E            'test_contexts.py::test_12[one]|run',
E         +  'test_contexts.py::test_12[one]|setup',
E         +  'test_contexts.py::test_12[one]|teardown',
E            'test_contexts.py::test_12[two]|run',
E         +  'test_contexts.py::test_12[two]|setup',
E         +  'test_contexts.py::test_12[two]|teardown',
E            'test_contexts.py::test_13[3-1]|run',
E         +  'test_contexts.py::test_13[3-1]|setup',
E         +  'test_contexts.py::test_13[3-1]|teardown',
E            'test_contexts.py::test_13[3-2]|run',
E         +  'test_contexts.py::test_13[3-2]|setup',
E         +  'test_contexts.py::test_13[3-2]|teardown',
E            'test_contexts.py::test_13[4-1]|run',
E         +  'test_contexts.py::test_13[4-1]|setup',
E         +  'test_contexts.py::test_13[4-1]|teardown',
E            'test_contexts.py::test_13[4-2]|run',
E         +  'test_contexts.py::test_13[4-2]|setup',
E         +  'test_contexts.py::test_13[4-2]|teardown',
E           }

/home/runner/work/pytest-cov/pytest-cov/tests/test_pytest_cov.py:1937: AssertionError
----------------------------- Captured stdout call -----------------------------
running: /home/runner/work/pytest-cov/pytest-cov/.tox/py310-pytest71-xdist250-coverage65/bin/python -mpytest --basetemp=/tmp/pytest-of-runner/pytest-0/test_contexts1/runpytest-0 -v --cov=/tmp/pytest-of-runner/pytest-0/test_contexts1 --cov-context=test /tmp/pytest-of-runner/pytest-0/test_contexts1/test_contexts.py -n 1 --basetemp=/tmp/pytest-of-runner/pytest-0/basetemp
     in: /tmp/pytest-of-runner/pytest-0/test_contexts1
============================= test session starts ==============================
platform linux -- Python 3.10.8, pytest-7.1.2, pluggy-1.0.0 -- /home/runner/work/pytest-cov/pytest-cov/.tox/py310-pytest71-xdist250-coverage65/bin/python
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-runner/pytest-0/test_contexts1
plugins: forked-1.4.0, xdist-2.5.0, cov-4.0.0
gw0 I

[gw0] linux Python 3.10.8 cwd: /tmp/pytest-of-runner/pytest-0/test_contexts1

[gw0] Python 3.10.8 (main, Oct 18 2022, 06:43:21) [GCC 9.4.0]
gw0 [20]

scheduling tests via LoadScheduling

test_contexts.py::test_01 
[gw0] [  5%] PASSED test_contexts.py::test_01 
test_contexts.py::test_02 
[gw0] [ 10%] PASSED test_contexts.py::test_02 
test_contexts.py::OldStyleTests::test_03 
[gw0] [ 15%] PASSED test_contexts.py::OldStyleTests::test_03 
test_contexts.py::OldStyleTests::test_04 
[gw0] [ 20%] PASSED test_contexts.py::OldStyleTests::test_04 
test_contexts.py::test_05 
[gw0] [ 25%] PASSED test_contexts.py::test_05 
test_contexts.py::test_06 
[gw0] [ 30%] PASSED test_contexts.py::test_06 
test_contexts.py::test_07 
[gw0] [ 35%] PASSED test_contexts.py::test_07 
test_contexts.py::test_08 
[gw0] [ 40%] PASSED test_contexts.py::test_08 
test_contexts.py::test_09[1] 
[gw0] [ 45%] PASSED test_contexts.py::test_09[1] 
test_contexts.py::test_09[2] 
[gw0] [ 50%] PASSED test_contexts.py::test_09[2] 
test_contexts.py::test_09[3] 
[gw0] [ 55%] PASSED test_contexts.py::test_09[3] 
test_contexts.py::test_10 
[gw0] [ 60%] PASSED test_contexts.py::test_10 
test_contexts.py::test_11[1-101] 
[gw0] [ 65%] PASSED test_contexts.py::test_11[1-101] 
test_contexts.py::test_11[2-202] 
[gw0] [ 70%] PASSED test_contexts.py::test_11[2-202] 
test_contexts.py::test_12[one] 
[gw0] [ 75%] PASSED test_contexts.py::test_12[one] 
test_contexts.py::test_12[two] 
[gw0] [ 80%] PASSED test_contexts.py::test_12[two] 
test_contexts.py::test_13[3-1] 
[gw0] [ 85%] PASSED test_contexts.py::test_13[3-1] 
test_contexts.py::test_13[3-2] 
[gw0] [ 90%] PASSED test_contexts.py::test_13[3-2] 
test_contexts.py::test_13[4-1] 
[gw0] [ 95%] PASSED test_contexts.py::test_13[4-1] 
test_contexts.py::test_13[4-2] 
[gw0] [100%] PASSED test_contexts.py::test_13[4-2] 

---------- coverage: platform linux, python 3.10.8-final-0 -----------
Name               Stmts   Miss  Cover
--------------------------------------
test_contexts.py      58      0   100%
--------------------------------------
TOTAL                 58      0   100%

============================== 20 passed in 0.60s ==============================
=============================== warnings summary ===============================
.tox/py310-pytest71-xdist250-coverage65/lib/python3.10/site-packages/_pytest/config/__init__.py:1198
  /home/runner/work/pytest-cov/pytest-cov/.tox/py310-pytest71-xdist250-coverage65/lib/python3.10/site-packages/_pytest/config/__init__.py:1198: PytestRemovedIn8Warning: The --strict option is deprecated, use --strict-markers instead.
    self.issue_config_time_warning(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] tests/test_pytest_cov.py:367: condition: coverage.version_info >= (6, 3)
SKIPPED [1] tests/test_pytest_cov.py:1028: Since pytest-xdist 2.3.0 the parent sys.path is copied in the child process
SKIPPED [3] tests/test_pytest_cov.py:1141: condition: sys.platform != "win32"
SKIPPED [1] tests/test_pytest_cov.py:1952: condition: coverage.version_info >= (5, 0)
FAILED tests/test_pytest_cov.py::test_contexts[nodist] - AssertionError: asse...
FAILED tests/test_pytest_cov.py::test_contexts[xdist] - AssertionError: asser...
======= 2 failed, 120 passed, 6 skipped, 1 warning in 111.56s (0:01:51) ========
ERROR: InvocationError for command /home/runner/work/pytest-cov/pytest-cov/.tox/py310-pytest71-xdist250-coverage65/bin/pytest -vv (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py310-pytest71-xdist250-coverage65: commands failed
Error: Process completed with exit code 1.
ngie-eign commented 1 year ago

This is fixed on main with d9789afd. The issue won't be present in the next release.

opoplawski commented 1 year ago

Will there be a release soon? Thanks.

ionelmc commented 1 year ago

Yes there will, just need to find some time. Cross fingers for weekend :-)