You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like pytest keeps references to each fixture value, even if the test has finished. In our case it's closure with mimesis provider. For each test we create a provider or several of them. This leads to huge memory consumption of test suite.
this fixes memory consumption issue. But there's no any mention in documentation that provider objects are that heavy and one should construct them as few as possible. Probably issuing a warning on constructing 1000th provider would help many people who try to find out why their tests consume so much memory.
The text was updated successfully, but these errors were encountered:
Bug report
What's wrong
Open a REPL, create not-so-huge amount of providers:
Not examine memory footprint of the process: in my case it's 1,1g.
How is that should be
Why would I need so many providers? I never knew they're such heavy objects, I was using them naively in tests:
Seems like pytest keeps references to each fixture value, even if the test has finished. In our case it's closure with mimesis provider. For each test we create a provider or several of them. This leads to huge memory consumption of test suite.
I agree that correct use would be
this fixes memory consumption issue. But there's no any mention in documentation that provider objects are that heavy and one should construct them as few as possible. Probably issuing a warning on constructing 1000th provider would help many people who try to find out why their tests consume so much memory.
The text was updated successfully, but these errors were encountered: