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

Add a teardown function arg to the pedantic mode. #270

Open
jenstroeger opened this issue Oct 22, 2024 · 4 comments
Open

Add a teardown function arg to the pedantic mode. #270

jenstroeger opened this issue Oct 22, 2024 · 4 comments

Comments

@jenstroeger
Copy link

Thank you for this interesting pytest plugin 👍🏼

In my case I need to benchmark a function which inserts rows into a db. However, it can’t run more than once because entering the same rows again fails. At the moment I’m using pedantic with rounds=1 and iterations=1 (as per issue #9).

The pedantic mode has a setup argument and I think an equivalent teardown function would be useful — I’d just delete all rows such that benchmark could run the function again.

Cheers!

@winpat
Copy link
Contributor

winpat commented Oct 29, 2024

I added support for exactly this a while ago in #264. I will try to finalize the MR in the next couple of days.

@aguckenber-chwy
Copy link

https://pytest-benchmark.readthedocs.io/en/latest/pedantic.html#reference Just to be clear, this is documented but not released yet right? 5.1.0 doesn't have teardown though its documented.
image

@ionelmc
Copy link
Owner

ionelmc commented Nov 19, 2024

Not yet, latest docs are build from master, while stable is "latest release": https://pytest-benchmark.readthedocs.io/en/stable/pedantic.html#reference

There will be a release this week I think.

@ashvardanian
Copy link

@ionelmc, I'd love to add with this, if more hands are needed 🤗
Need this feature for the less_slow.py tutorial.

ashvardanian added a commit to ashvardanian/less_slow.py that referenced this issue Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants