jayvdb added a comment.
Grr. Sorry you're right.
So, to test, remove either the 'test' or 'wikidata' entry in self.langs of the official pywikibot/families/wikidata_family.py , so only the one you are testing is in the dict
i.e. to test the production wikidata, use:
self.langs = {
'wikidata': 'www.wikidata.org',
# 'test': 'test.wikidata.org',
}
Then you can use family = 'wikidata' ; mylang = 'en'
Or to run test on the test wikidata site, use:
self.langs = {
# 'wikidata': 'www.wikidata.org',
'test': 'test.wikidata.org',
}
And then you can use family = 'wikidata' ; mylang = 'en'
As there are lots of unit tests that depend on both test and production wikidata, to test your new date pagegen tests without lots of errors from other tests, use the following syntax to invoke only your test methods:
$ python -m unittest tests.pagegeerators_tests.YourTestClass.test_your_test_method
(see tests/README.rst for more info)
TASK DETAIL
https://phabricator.wikimedia.org/T85645
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, Aklapper, Unicornisaurous, jayvdb, XZise
XZise added a subscriber: XZise.
XZise added a comment.
Yeah that doesn't work for wikidata. It has two “languages”: “wikidata” and “test” so it won't automatically choose “wikidata” if the language doesn't match. This is actually https://phabricator.wikimedia.org/T71255.
TASK DETAIL
https://phabricator.wikimedia.org/T85645
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: XZise
Cc: pywikipedia-bugs, Aklapper, Unicornisaurous, jayvdb, XZise
Unicornisaurous added a comment.
Hmm, that isn't working for me. Now its failing differently:
Traceback (most recent call last):
File "/path/to/core/tests/aspects.py", line 455, in setUpClass
super(CheckHostnameMixin, cls).setUpClass()
File "/path/to/core/tests/aspects.py", line 816, in setUpClass
interface=interface)
File "/path/to/core/pywikibot/__init__.py", line 600, in Site
_sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop)
File "/path/to/core/pywikibot/site.py", line 1514, in __init__
BaseSite.__init__(self, code, fam, user, sysop)
File "/path/to/core/pywikibot/site.py", line 518, in __init__
% (self.__code, self.__family.name))
UnknownSite: Language 'en' does not exist in family wikidata
TASK DETAIL
https://phabricator.wikimedia.org/T85645
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: Unicornisaurous
Cc: pywikipedia-bugs, Aklapper, Unicornisaurous, jayvdb
jayvdb added a comment.
The final fix for this problem is probably going to depend on https://phabricator.wikimedia.org/T71255 , which is a complex but low priority problem.
As an interim measure, you should be able use the following in your user-config.py to bypass this problem
family = 'wikidata'
mylang = 'en'
That should let you continue to find other bugs in using the date module when used with Wikidata.
(Also, due to https://phabricator.wikimedia.org/T85331 not being implemented, you'll need to test using the 'wikidata' family distributed as pywikibot/families/wikidata_family.py , as it has hard-coded data needed to use wikidata)
TASK DETAIL
https://phabricator.wikimedia.org/T85645
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, Aklapper, Unicornisaurous, jayvdb