Skip to content

Added plugin to filter by sub-packages #19

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

Closed
wants to merge 1 commit into from

Conversation

astrofrog
Copy link
Member

This is a small plugin that was inspired by discussions in astropy/astropy-APEs#52 - basically this adds the ability to do e.g.

pytest -P io.fits,constants

However, this only works for now if I remove:

doctest_plus = enabled

from setup.cfg, so I need to spend more time to understand how to get the plugins to work nicely.

Note that this also makes pytest-astropy into a real package rather than just a meta-package. I think this plugin is too astropy-specific to put in a standalone plugin.

@pllim
Copy link
Member

pllim commented Jun 27, 2019

Is this really necessary? pytest can already support collecting only tests from given directories, and our subpackages are organized in directories. Wouldn't something like this already be sufficient?

pytest astropy/io/fits/ astropy/io/misc/

@astrofrog
Copy link
Member Author

astrofrog commented Jun 27, 2019

@pllim - I got asked several times in astropy/astropy-APEs#52 for this functionality, so just thought I'd give it a shot - @bsipocz and others listed it as a critical feature of python setup.py test that they can't do without :)

Note that this isn't just equivalent to:

pytest astropy/io/fits/ astropy/io/misc/

it's equivalent to:

pytest astropy/io/fits/ astropy/io/misc/ docs/io/fits docs/io/misc

so it does save a bit of typing.

I never plan on using this though, I'm fine with just calling pytest with the explicit paths.

@pllim
Copy link
Member

pllim commented Jun 27, 2019

calling pytest with the explicit paths

Explicit is better than implicit, right? Maybe they just have to deal with a bit more typing and less maintenance for us.

@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2019

I have strong feeling about it that we need this, otherwise many would end up not testing the docs. And it's convenient, too. And honestly we maintain less useful stuff all over the place.

@pllim
Copy link
Member

pllim commented Dec 12, 2019

There's a conflict.

@astrofrog
Copy link
Member Author

I split this out into a separate plugin package: https://github.com/astropy/pytest-filter-subpackage - so I'll close this for now, and once that plugin is released we can add it as a dependency for pytest-astropy.

@astrofrog astrofrog closed this Dec 29, 2019
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

Successfully merging this pull request may close these issues.

3 participants