Skip to content

pytest_ignore_collect applies to all directories collected afterwards? #2016

Closed
@d-b-w

Description

@d-b-w

I put a pytest_ignore_collect() in a conftest.py. From the documentation, I had expected it to apply to all subdirectories of the one in which the conftest.py resides. However, it also prevented collection of files that were not in subdirectories!

I have this directory structure:

demo_parent/childa/conftest.py
demo_parent/childa/demo_test.py
demo_parent/childb/demo_test.py

demo_test.py are both def test(): pass. When I add def pytest_ignore_collect(path, config): return True to the conftest.py, neither of the tests are executed! I would have expected childb/demo_test.py to run.

platform darwin -- Python 2.7.10, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
plugins: hypothesis-3.4.0, cov-2.2.1, faulthandler-1.3.0, xdist-1.14

also:
execnet==1.4.1
hypothesis==3.4.0
coverage==4.0.3

I've observed this on Linux, and Mac.

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