jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/722547 )
Change subject: [cleanup] Remove outdated intoken from TestRequest ......................................................................
[cleanup] Remove outdated intoken from TestRequest
intoken isn't used by any request
Bug: T291202 Change-Id: Ice16d5c8d3410c9ebbfa2ef25430aaf9f5074fe9 --- M tests/__init__.py 1 file changed, 7 insertions(+), 16 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/__init__.py b/tests/__init__.py index 68a10a3..f802c45 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -304,30 +304,21 @@ """Never invalidate cached data.""" return False
- def _load_cache(self): + def _load_cache(self) -> bool: """Return whether the cache can be used.""" if not super()._load_cache(): return False
- # tokens need careful management in the cache - # and can't be aggressively cached. - # FIXME: remove once 'badtoken' is reliably handled in api.py - for desc in ('intoken', 'lgpassword'): - if desc in self._uniquedescriptionstr(): - self._data = None - return False + if 'lgpassword' in self._uniquedescriptionstr(): + self._data = None + return False
return True
- def _write_cache(self, data): + def _write_cache(self, data) -> None: """Write data except login details.""" - if 'intoken' in self._uniquedescriptionstr(): - return None - - if 'lgpassword' in self._uniquedescriptionstr(): - return None - - return super()._write_cache(data) + if 'lgpassword' not in self._uniquedescriptionstr(): + super()._write_cache(data)
original_expired = None
pywikibot-commits@lists.wikimedia.org