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

Multiplying tests should happen after -k #15

Open
blueyed opened this issue Apr 24, 2017 · 6 comments
Open

Multiplying tests should happen after -k #15

blueyed opened this issue Apr 24, 2017 · 6 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Apr 24, 2017

When used with -k to select only some specific tests, pytest still collects all tests, multiplied by the number passed to --count.

Therefore pytest --count=120 -x -k test_foo will collect the number of total tests times 120, which results in a lot of processing and memory usage.

I can imagine that pytest-repeat could be improved in this regard to only multiply the collected tests after -k was applied.

The workaround here is to specify the file containing the test, but that still multiplies the tests contained in this file.

platform linux -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
cachedir: .cache
Django settings: velodrome.settings (from environment variable)
plugins: testmon-0.9.4, repeat-0.4.1, profiling-1.2.6, pdb-0.2.0, mock-1.6.0, django-3.1.2, catchlog-1.2.2, asyncio-0.5.0, pylama-7.3.3
@RonnyPfannschmidt
Copy link
Member

@blueyed that is currently structurally impossible as of now since the multiplication uses a hidden autouse fixture as its about the only sane way to do it atm

@blueyed
Copy link
Contributor Author

blueyed commented Oct 27, 2019

@RonnyPfannschmidt
Isn't it possible to create new items in pytest_collection_modifyitems instead, based on copying an existing one?

@RonnyPfannschmidt
Copy link
Member

no

@blueyed
Copy link
Contributor Author

blueyed commented Oct 27, 2019

Well, it's not easily possible, but should be probably, shouldn't it?

As for now / anyway, see pytest-dev/pytest#6078.

@blueyed blueyed closed this as completed Oct 27, 2019
@blueyed
Copy link
Contributor Author

blueyed commented Oct 27, 2019

@RonnyPfannschmidt
btw: the autouse fixture is removed in #40.

@blueyed blueyed reopened this Oct 27, 2019
@tylovescodes
Copy link

What's the status on this issue? Is this being worked on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants