jayvdb created this task.
jayvdb added a subscriber: jayvdb.
jayvdb added projects: pywikibot-core, Pywikibot-tests.
Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION
In the test suite, TestRequest and DryRequest replace the original Request class as
required, however any call to CachedRequest bypasses these alternative implementations.
The constructor of CachedRequest accepts an extra 'expiry' parameter at the
first position which does not appear in the super class Request.
TestRequest subclasses CachedRequest, but doesnt use the parent classes constructor
signature, as doesnt have an 'expiry' - instead it has a hard-coded expiry.
The simplest approach is to create TestCachedRequest which matches the constructor
signature of CachedRequest, and replaces CachedRequest in the test suite. (and do the same
for DryRequest)
Another approach to unravel this mess is to move the CachedRequest expiry parameter to a
named keyword parameter which is mandatory/has a default (similar to 'site'),
which would require a funky decorator to deprecate calling CachedRequest with a literal
number as the first parameter.
Then TestRequest and DryRequest can be used as a replacement for CachedRequest, and
would simply ignore the 'expiry' parameter if it exists.
TASK DETAIL
https://phabricator.wikimedia.org/T93175
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign
<username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb
Cc: pywikipedia-bugs, jayvdb, Aklapper