-
Notifications
You must be signed in to change notification settings - Fork 473
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
Fixe #611: audit fails with custom plugin #621
base: master
Are you sure you want to change the base?
Conversation
@@ -71,6 +71,7 @@ def default_settings() -> Generator['Settings', None, None]: | |||
for plugin_type in get_mapping_from_secret_type_to_class().values() | |||
], | |||
}) as settings: | |||
get_mapping_from_secret_type_to_class.cache_clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much does the performance get affected by adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings.defailt_settings
is called usually only once to setup the parser or run tests, so performance impact should be minimal
Appears the filters.common_filter_test.py makes use of testing.pugins.register_plugin. This contextmanager relies specifically on get_mapping_from_secret_type_to_class having an lru_cache. It actually inserts plugins into the cache. These of course get purged by my code. I would say this is a problem with the test framework. I will try to find a solution |
@steamraven have you manually tested your branch besides running the test suite we have? |
I have manually tested with the minimal plugin and baseline and it fixes the issue. It appears I am failing on autopep8 at the moment. I can try to write up some full tests to test my issue, but that will take bit. |
That's okay, I'd rather have coverage of this. Thank you for your contribution! |
Clear a lru_cache when creating default_settings