-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Share script fixtures across tests #7276
Conversation
b2376b4
to
191df15
Compare
191df15
to
0c4625b
Compare
Nice idea 👍 |
I expect the usage of an individual fixture to be small enough that its intended use should be clear. If they start to get too big then it should be easy enough to add a whitelist on each instance as appropriate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you measure the speedup for tests/functional/test_completion.py
& tests/functional/test_list.py
?
On my machine™, with times averaged over 5 runs, it looks like:
Progress on pytest-dev/pytest-xdist#18 would probably improve this some (especially if the files are executed at the same time). |
Thanks for reviewing @xavfernandez! |
We now have a
script_factory
pytest fixture that we can use to create reusable script objects. These can be used across multiple tests.This helps because each usage of the plain
script
fixture requires:tests.lib.TestData
via thedata
fixture)I just picked two example functional test files to start - I think there are a lot more opportunities to improve our test speed here.
Makes progress on #4497.