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

Exclude setup/teardown from leak checking #17

Open
pv opened this issue Jul 23, 2019 · 1 comment
Open

Exclude setup/teardown from leak checking #17

pv opened this issue Jul 23, 2019 · 1 comment

Comments

@pv
Copy link
Collaborator

pv commented Jul 23, 2019

Currently, the leak checking encompasses the whole setup/call/teardown cycle. This is maybe not optimal, since some pytest fixtures appear to leak, and those leaks are usually not of interest.

It would be possible to split the refleak run cycle todo

setup()
cleanup()
before = get_counts()
test()
cleanup()
after = get_counts()
deltas = after - before
teardown()

instead of the current

setup()
test()
teardown()
cleanup()
after = get_counts()
deltas = after - before
before = after

but it comes at the price of two cleanups, which I guess are required before "get_counts" for stable numbers.

@pv pv added the enhancement label Jul 23, 2019
@pv pv mentioned this issue Jul 23, 2019
@pv
Copy link
Collaborator Author

pv commented Jul 24, 2019

Not sure how feasible this is though: Calling via the hook pytest_runpytest_call enables e.g. the logging fixture (on by default) which hold references from call to teardown and would seem to leak if done like this. OTOH, calling directly without the hook disables output capture, so also not ok.

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

1 participant