ipwnponies/pytest-antilru

Should not sys.exit, this exits pytest

Closed this issue · 0 comments

sys.exit('Cannot use pytest-antilru, no lru_cache installed!')

What's wrong

If lru_cache is not found, this plugin will make pytest immediately terminate.

This means the user is not even using lru_cache. This can be an unnecessary installation of this plugin or a test environment misconfiguration.

This doesn't apply to python 3, functools.lru_cache is in the stdlib and always available.

Proposed Solution

We should use pytest calls to set a failure, so that pytest can report it as such.

Note: If there's a request for warning instead of failing, we can make the plugin noop. Probably if a package is using some python testing template but doesn't need this plugin. But this seems like supporting workaround instead, not in the scope of this ticket.