pytest-repeat
pytest-repeat copied to clipboard
Multiplying tests should happen after -k
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
@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
@RonnyPfannschmidt Isn't it possible to create new items in pytest_collection_modifyitems instead, based on copying an existing one?
no
Well, it's not easily possible, but should be probably, shouldn't it?
~~As for now / anyway, see https://github.com/pytest-dev/pytest/pull/6078.~~
@RonnyPfannschmidt btw: the autouse fixture is removed in https://github.com/pytest-dev/pytest-repeat/pull/40.
What's the status on this issue? Is this being worked on?