Skip to content

Since pytest 6.0.0, pylint complains about unimplemented abstract methods in custom collector #7591

@andy-maier

Description

@andy-maier

Hi, we have implemented a custom pytest collector that takes testcases from YAML files. Starting with pytest 6.0.0, pylint reports the following about that collector:

tests/functiontest/conftest.py:225:0: W0223: Method 'get_closest_marker' is abstract in class 'Node' but is not overridden (abstract-method)
tests/functiontest/conftest.py:225:0: W0223: Method 'gethookproxy' is abstract in class 'FSCollector' but is not overridden (abstract-method)
tests/functiontest/conftest.py:225:0: W0223: Method 'isinitpath' is abstract in class 'FSCollector' but is not overridden (abstract-method)
tests/functiontest/conftest.py:252:0: W0223: Method 'get_closest_marker' is abstract in class 'Node' but is not overridden (abstract-method)

The collector has worked fine for a long time, and it still works fine.

The line pylint reports this on is the class definition of a collector class that is based on pytest.File:

class YamlFile(pytest.File):

    def collect(self):  # The only method in this class
        . . . 

The whole source code is here: https://github.com/pywbem/pywbem/blob/master/tests/functiontest/conftest.py#L225

Versions:

Python 3.8.0 (default, Oct 15 2019, 17:49:23). This happens on all Python 3.x versions we used pytest 6.0.1 with (3.5, 3.6, 3.7, 3.8), on macOS and Ubuntu.

pylint 2.4.4
astroid 2.3.3

platform linux -- Python 3.8.0, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
plugins: cov-2.10.0, yagot-0.5.0, requests-mock-1.8.0

Please let me know in case a collector has to implement these methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions