Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fails with coverage 6.5.0 #570

Open
danigm opened this issue Nov 28, 2022 · 3 comments
Open

Tests fails with coverage 6.5.0 #570

danigm opened this issue Nov 28, 2022 · 3 comments

Comments

@danigm
Copy link

danigm commented Nov 28, 2022

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.
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Nov 28, 2022
https://build.opensuse.org/request/show/1038610
by user dgarcia + dimstar_suse
- Disable failing tests (test_contexts) that fails because of the new version
  of python-coverage, gh#pytest-dev/pytest-cov#570
- Remove support-coverage-62.patch
- Remove support-setuptools60.patch
- Update to 4.0.0:
  * --cov-fail-under no longer causes pytest --collect-only to fail Contributed
    by Zac Hatfield-Dodds in #511.
  * Dropped support for multiprocessing (mostly because issue 82408). This
    feature was mostly working but very broken in certain scenarios and made
    the test suite very flaky and slow.
  * There is builtin multiprocessing support in coverage and you can migrate to
    that. All you need is this in your .coveragerc:
       [run]
       concurrency = multiprocessing
       parallel = true
       sigterm = true
  * Fixed deprecation in setup.py by trying to i
@ngie-eign
Copy link

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

ngie-eign added a commit to ngie-eign/freebsd-ports that referenced this issue Mar 13, 2023
Summary:
This is required so py-pytest-cov is functional with newer versions of
py-pytest-xdist [1].

Backport patches from upstream commit to [selectively] add 3.11 support
to make some of the tests not fail when run with newer versions of
coverage.py [2].

While here, appease portlint by shifting where variables (`CONFLICTS`,
etc) are defined.

1. pytest-dev/pytest-cov#422
2. pytest-dev/pytest-cov#570

PR:	269360
Co-Authored-With:	Yuri Victorovich <yuri@freebsd.org>

Test Plan: `make test` passes with this change.

Reviewers: dbaio

Subscribers: mat, yuri

Differential Revision: https://reviews.freebsd.org/D39035
ngie-eign added a commit to ngie-eign/freebsd-ports that referenced this issue Mar 24, 2023
Summary:
This is required so py-pytest-cov is functional with newer versions of
py-pytest-xdist [1].

Backport patches from upstream commit to [selectively] add 3.11 support
to make some of the tests not fail when run with newer versions of
coverage.py [2].

While here, appease portlint by shifting where variables (`CONFLICTS`,
etc) are defined.

1. pytest-dev/pytest-cov#422
2. pytest-dev/pytest-cov#570

PR:	269360
Co-Authored-With:	Yuri Victorovich <yuri@freebsd.org>

Test Plan: `make test` passes with this change.

Reviewers: dbaio

Subscribers: mat, yuri

Differential Revision: https://reviews.freebsd.org/D39035
@opoplawski
Copy link

Will there be a release soon? Thanks.

ngie-eign added a commit to ngie-eign/freebsd-ports that referenced this issue May 6, 2023
Summary:
This is required so py-pytest-cov is functional with newer versions of
py-pytest-xdist [1].

Backport patches from upstream commit to [selectively] add 3.11 support
to make some of the tests not fail when run with newer versions of
coverage.py [2].

While here, appease portlint by shifting where variables (`CONFLICTS`,
etc) are defined.

1. pytest-dev/pytest-cov#422
2. pytest-dev/pytest-cov#570

PR:	269360
Co-Authored-With:	Yuri Victorovich <yuri@freebsd.org>

Test Plan: `make test` passes with this change.

Reviewers: dbaio

Subscribers: mat, yuri

Differential Revision: https://reviews.freebsd.org/D39035
@ionelmc
Copy link
Member

ionelmc commented May 8, 2023

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

ngie-eign added a commit to ngie-eign/freebsd-ports that referenced this issue Jun 23, 2023
Summary:
This is required so py-pytest-cov is functional with newer versions of
py-pytest-xdist [1].

Backport patches from upstream commit to [selectively] add 3.11 support
to make some of the tests not fail when run with newer versions of
coverage.py [2].

While here, appease portlint by shifting where variables (`CONFLICTS`,
etc) are defined.

1. pytest-dev/pytest-cov#422
2. pytest-dev/pytest-cov#570

PR:	269360
Co-Authored-With:	Yuri Victorovich <yuri@freebsd.org>

Test Plan: `make test` passes with this change.

Reviewers: dbaio

Subscribers: mat, yuri

Differential Revision: https://reviews.freebsd.org/D39035
ngie-eign added a commit to ngie-eign/freebsd-ports that referenced this issue Jul 27, 2023
Summary:
This is required so py-pytest-cov is functional with newer versions of
py-pytest-xdist [1].

Backport patches from upstream commit to [selectively] add 3.11 support
to make some of the tests not fail when run with newer versions of
coverage.py [2].

While here, appease portlint by shifting where variables (`CONFLICTS`,
etc) are defined.

1. pytest-dev/pytest-cov#422
2. pytest-dev/pytest-cov#570

PR:	269360
Co-Authored-With:	Yuri Victorovich <yuri@freebsd.org>

Test Plan: `make test` passes with this change.

Reviewers: dbaio

Subscribers: mat, yuri

Differential Revision: https://reviews.freebsd.org/D39035
ngie-eign added a commit to ngie-eign/freebsd-ports that referenced this issue Aug 4, 2023
Summary:
This is required so py-pytest-cov is functional with newer versions of
py-pytest-xdist [1].

Backport patches from upstream commit to [selectively] add 3.11 support
to make some of the tests not fail when run with newer versions of
coverage.py [2].

While here, appease portlint by shifting where variables (`CONFLICTS`,
etc) are defined.

1. pytest-dev/pytest-cov#422
2. pytest-dev/pytest-cov#570

PR:	269360
Co-Authored-With:	Yuri Victorovich <yuri@freebsd.org>

Test Plan: `make test` passes with this change.

Reviewers: dbaio

Subscribers: mat, yuri

Differential Revision: https://reviews.freebsd.org/D39035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants