Skip to content
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

not collect deselected tests #239

Closed
pytestbot opened this issue Dec 13, 2012 · 6 comments
Closed

not collect deselected tests #239

pytestbot opened this issue Dec 13, 2012 · 6 comments
Labels
topic: collection related to the collection phase topic: selection related to test selection from the command line type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Anonymous


Some tests can be generating multiple tests through @pytest.mark.parametrize() or metafunc.parametrize, however if those tests are marked and specified not to run (through -m "not marker" command line argument) they are still collected first and then are deselected.

In my specific case, one of @pytest.mark.parametrize() is generating around 500 tests - only to be deselected afterwards. This makes a long test even longer.

Suggestion: to add an option not to generate (or not to collect) tests that are not required.

Thanks!


@pytestbot
Copy link
Contributor Author

Original comment by Alex Okrushko (BitBucket: alex_okrushko, GitHub: alex_okrushko):


forgot to log in first

@pytestbot pytestbot added the type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature label Jun 15, 2015
@pfctdayelise pfctdayelise added topic: collection related to the collection phase topic: selection related to test selection from the command line labels Jul 25, 2015
@pfctdayelise
Copy link
Contributor

One thing I am worried about is that you maybe can't know until the test has been collected. This would be unsafe for sure with -k, maybe with -m it is safer. But for example a fixture can dynamically add a marker. So you'd want to have that happen before selecting tests.

@RonnyPfannschmidt
Copy link
Member

Sounds like we still can do a best effort

@pfctdayelise
Copy link
Contributor

True, we could do it twice.

@RonnyPfannschmidt
Copy link
Member

as far as i can tell, we can make collectors bail out early, we'd still have to report the bailout in some way and figure how to do report collector deselection

its def not a easy or short term task

@RonnyPfannschmidt
Copy link
Member

Closing, the issue should be tackled with better collection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase topic: selection related to test selection from the command line type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

3 participants