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
When optimizing performance in tests, one thing you can do is take things that are deterministic, but expensive (such as encryption related functions) and cache them.
This issue is to make generic functions to create these kinds of patches. I would imagine unique values can get created on demand rather than pre-making them. Then every test, the uuid4 will return the same values in the same order (similar to a side_effect)
Another example. This one does a cached list for each unique arguments.
Testing with the pytest hot reloader it looks like there's a compatibility issue with re-runs and using the lru cache. Restructuring so the function isn't defined inside a nested scope fixed the issue.
When optimizing performance in tests, one thing you can do is take things that are deterministic, but expensive (such as encryption related functions) and cache them.
For example:
To leverage this, you probably also have to make things that are random deterministic. Example:
This issue is to make generic functions to create these kinds of patches. I would imagine unique values can get created on demand rather than pre-making them. Then every test, the uuid4 will return the same values in the same order (similar to a
side_effect
)Another example. This one does a cached list for each unique arguments.
The text was updated successfully, but these errors were encountered: