Skip to content

Make --ignore flag work with --pyargs  #3287

@rth

Description

@rth

I just discovered the --pyargs option and it's very practical. However it does not seem to take into account the --ignore options.

Example,

$ pytest --doctest-modules  --pyargs setuptools
============================================ test session starts ============================================
platform linux -- Python 3.6.4, pytest-3.4.1, py-1.5.2, pluggy-0.6.0
rootdir: /home/rth, inifile:
plugins: profiling-1.2.11
collected 6 items                                                                                           

anaconda2/envs/testn-env/lib/python3.6/site-packages/setuptools/namespaces.py .                       [ 16%]
anaconda2/envs/testn-env/lib/python3.6/site-packages/setuptools/package_index.py .                    [ 33%]
anaconda2/envs/testn-env/lib/python3.6/site-packages/setuptools/sandbox.py .                          [ 50%]
anaconda2/envs/testn-env/lib/python3.6/site-packages/setuptools/command/develop.py .                  [ 66%]
anaconda2/envs/testn-env/lib/python3.6/site-packages/setuptools/command/install_lib.py .              [ 83%]
anaconda2/envs/testn-env/lib/python3.6/site-packages/setuptools/command/py36compat.py .               [100%]

========================================= 6 passed in 0.52 seconds ==========================================

running,

pytest --doctest-modules --ignore develop.py  --pyargs setuptools

produces exactly identical output, while I would have expected the develop.py not to be tested.
Here is another example of this same issue.

Is there a way around it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: collectionrelated to the collection phasetype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions