Skip to content

Fix pytest 4.1 compatibilty #12934

@rth

Description

@rth

The pytest 4.1 removes a number of deprecated features (and deprecates others), see changelog.

In #12931 all tests fail with pytest 4.1, with,

__________________________ test_affinity_propagation ___________________________
self = <pytest_cov.plugin.CovPlugin object at 0x7ffa393f27f0>
item = <Function test_affinity_propagation>
    @compat.hookwrapper
    def pytest_runtest_call(self, item):
>       if (item.get_marker('no_cover')
                or 'no_cover' in getattr(item, 'fixturenames', ())):
E               AttributeError: 'Function' object has no attribute 'get_marker'
item       = <Function test_affinity_propagation>
self       = <pytest_cov.plugin.CovPlugin object at 0x7ffa393f27f0>
/home/travis/build/scikit-learn/scikit-learn/testvenv/lib/python3.5/site-packages/pytest_cov/plugin.py:289: AttributeError

this would need more investigation, but it if turns out that we were using a deprecated pytest feature the fix should also be backported to the 0.20.X branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions