lepture/flask-oauthlib — pull request #109 by dokterbob (2014-07-16 14:57:57+00:00)
Title: Don’t cache remote properties

In #23 a choice was made to load configuration from Flask rather than having to hardcode credentials, which was a *great* decision. However, for some reason the choice was made to actually cache the configuration options.

This creates problems in certain test situations (our specific case was we needed to use the same remote with different URL's depending on whether doing integration in the browser tests or unit tests with a test client).

As the `_get_property` method seems to do nothing more than a `getattr` and/or dictionary lookups it should be quite fast already, in any case about as fast as `cached_property` which seems to use a dict. Hence, caching here (or actually memoizing) limits a particularly great feature of Flask (dynamic configuration) in return for very little else.

The pull req. contains a test demonstrating the fail case. You might also want to replace lazy by dynamic configuration (or deprecate hardcoded credentials in general and simply refer to the only proper method without adverbs).

In any case: thanks for your efforts in writing this and your attention reviewing this issue! :)