Last modified: 2014-04-21 09:32:40 UTC
Running page_tests an error occurs: c:\Pywikipedia\ssh\pywikibot\core>pwb.py tests/page_tests ...E............. ====================================================================== ERROR: testApiMethods (__main__.TestPageObject) Test various methods that rely on API. ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/page_tests.py", line 297, in testApiMethods self.assertType(mainpage.editTime(), pywikibot.Timestamp) File "C:\Pywikipedia\ssh\pywikibot\core\pywikibot\page.py", line 457, in editT ime return self._revisions[rev].timestamp KeyError: 598252063 ---------------------------------------------------------------------- Ran 17 tests in 0.440s FAILED (errors=1) c:\Pywikipedia\ssh\pywikibot\core> Seems that self.site.loadrevisions(self) in editTime() method does not load the needed revision as expected.
Works for me after cleaning apicache.
The following fails if family is not "wikipedia" in user-config.py: ....F............ ====================================================================== FAIL: testGeneral (page_tests.TestPageObject) ---------------------------------------------------------------------- Traceback (most recent call last): File "page_tests.py", line 116, in testGeneral % (site.lang, mainpage.title())) AssertionError: '[[wikipedia:en:Main Page]]' != u'[[en:Main Page]]' ---------------------------------------------------------------------- Ran 17 tests in 1.200s It should not be mandatory to run tests using wikipedia as config family.
Cleaning the api cache was my first thougth but it still happened
2nd part (AssertionError) fixed in https://gerrit.wikimedia.org/r/#/c/127435/
Change 127435 had a related patch set uploaded by Merlijn van Deen: (bug 64137) Some more Page.title() testing https://gerrit.wikimedia.org/r/127435
Change 127435 merged by jenkins-bot: (bug 64137) Some more Page.title() testing https://gerrit.wikimedia.org/r/127435
I found it: It was apicache. But why does tests have it's own cache?