-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: Don't "skip" this file, "ignore" this file. #3844
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
Comments
Hi @dev351 thanks for writing. May I ask why do you need to suppress the SKIPPED message for the test files? Seems strange because users won't get any feedback and might wonder if there's some problem with their configuration or environment that is not picking up the test modules that are being ignored. |
Yes. I have a Python package skeleton project that provides a number of example The only ways I see to suppress the "SKIPPED" output on all these example tests was to:
My proposal, I feel, extends nicely from the existing mechanism for "skipping" all tests in a file. Thanks for your consideration. |
there is multiple mechanisms for ignoring files already which actually prevents it from collection at all so i don`t see any value in a ignored marker |
Related: #3730 ("silently skip a test"). |
This would be extremely useful to me in several scenarios. Pytest makes it easy (esp. through parametrization and parametrized fixtures) to test a cartesian product of parameter combinations. It's slightly less easy (not least because fixtures can't be reused as parameters) to reduce that cartesian product where necessary. Often, certain combination simply do not make sense (for what's being tested), and currently, one can only really But skips and xfails get output to the log (and for good reason - they should command attention and be eventually fixed), and so it's quite a simple consideration that one does not want to pollute the result with skipping invalid parameter combinations. For this task, |
@h-vetinari now ignoring a file and deselecting tests are 2 very different kinds of things, please open a new issue i'm going to close this one as wont-fix as its about ignoring whole files |
@RonnyPfannschmidt |
While the
pytestmark = pytest.mark.skip
in the global scope is useful for skipping all tests in a file, it would be useful to be able to "ignore" the file altogether using a similar global assignment. That is, be able to provide a marker in the test file that will hide the module from discovery in the same manner as--ignore=<test-file>
does on the command line.My motivation here is as follows.
pytest.mark.skip
emits SKIPPED messages for each test in the file when the-v
flag. Whereas, it would also be useful to suppress that output altogether by simply "ignoring" the file.My enhancement proposal is provide "ignore" behaviour around the follow global syntax (or similar):
pytestmark = pytest.mark.ignore
The text was updated successfully, but these errors were encountered: