Skip to content

Improve test speed with some cached_property decorators#2541

Merged
shtlrs merged 1 commit into
mainfrom
faster-tests
Apr 15, 2023
Merged

Improve test speed with some cached_property decorators#2541
shtlrs merged 1 commit into
mainfrom
faster-tests

Conversation

@wookie184
Copy link
Copy Markdown
Contributor

There are definitely more improvements to be made, and this probably isn't really addressing the root cause, but it is a quick win that should have no effect on behaviour/effectiveness of tests.

Previously on my laptop tests took 50-60 seconds to run, with this change they only take ~20 seconds.

The source of slowdown was discovered using pytest-profiling. create_autospec is apparently very slow. The changes to the roles on MockGuild have a smaller improvement but still seem to gain a few seconds.

@shtlrs shtlrs merged commit 835ee25 into main Apr 15, 2023
@shtlrs shtlrs deleted the faster-tests branch April 15, 2023 16:57
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

Successfully merging this pull request may close these issues.

3 participants