Skip to content

Add ability to use globs when using --ignore #4722

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

Merged
merged 3 commits into from
Feb 8, 2019

Conversation

fetzerch
Copy link
Contributor

@fetzerch fetzerch commented Feb 5, 2019

This changes the --ignore option to allow Unix-style wildcards so
that --ignore=integration* excludes all tests that reside in files
starting with integration.

Fixes: #3711

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even tho this is a really nice change, its breaking backward compatibility, i propose adding a --ignore-glob parameter

@nicoddemus
Copy link
Member

even tho this is a really nice change, its breaking backward compatibility, i propose adding a --ignore-glob parameter

I agree; while I think few users are using * or . in that setting, [] seems more likely.

@fetzerch
Copy link
Contributor Author

fetzerch commented Feb 6, 2019

I'll update the PR to introduce a new --ignore-glob parameter. While I'm at it, it appears to be relatively easy to also add support for collect_ignore_glob in conftest.py. Does this make sense to you?

This adds the `--ignore-glob` option to allow Unix-style wildcards so
that `--ignore-glob=integration*` excludes all tests that reside in
files starting with `integration`.

Fixes: pytest-dev#3711
@nicoddemus
Copy link
Member

nicoddemus commented Feb 6, 2019

I'll update the PR to introduce a new --ignore-glob parameter.

Great, thanks!

While I'm at it, it appears to be relatively easy to also add support for collect_ignore_glob in conftest.py. Does this make sense to you?

Sorry, what do you mean, a new option, or hook, ?

@fetzerch
Copy link
Contributor Author

fetzerch commented Feb 6, 2019

PR is updated now with the --ignore-glob parameter and support for collect_ignore_glob.

While I'm at it, it appears to be relatively easy to also add support for collect_ignore_glob in conftest.py. Does this make sense to you?

Sorry, what do you mean, a new option, or hook, ?

See my second commit. I thought it might be useful and implemented it right away.

@blueyed
Copy link
Contributor

blueyed commented Feb 6, 2019

The option collect_ignore_glob could also be used via -o … then, i.e. there wouldn't be the need for a separate CLI option/arg.

This adds the `collect_ignore_glob` option for `conftest.py` to allow
Unix-style wildcards for excluding files.
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome contribution @fetzerch, thanks a lot! 🤗

@nicoddemus
Copy link
Member

The option collect_ignore_glob could also be used via -o … then, i.e. there wouldn't be the need for a separate CLI option/arg.

I agree with this idea for new options, but given that we have --collect-ignore already, for consistency I think it is OK to have --collect-ignore-glob as well. 👍

@blueyed
Copy link
Contributor

blueyed commented Feb 8, 2019

@RonnyPfannschmidt
Please re-review.

@blueyed blueyed merged commit fc8800c into pytest-dev:features Feb 8, 2019
@blueyed
Copy link
Contributor

blueyed commented Feb 8, 2019

Thank you!

@fetzerch fetzerch deleted the ignore_wildcards branch February 9, 2019 06:38
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.

4 participants