Page MenuHomePhabricator

Tests fails on Appveyor due to TypeError: Optional[t] requires a single type
Closed, ResolvedPublic

Description

======================================================================
[00:02:03] ERROR: tests (unittest.loader._FailedTest)
[00:02:03] ----------------------------------------------------------------------
[00:02:03] Traceback (most recent call last):
[00:02:03]   File "C:\projects\pywikibot-g4xqx\tests\__init__.py", line 264, in load_tests
[00:02:03]     return collector(loader)
[00:02:03]   File "C:\projects\pywikibot-g4xqx\tests\__init__.py", line 255, in collector
[00:02:03]     tests = loader.loadTestsFromNames(test_list)
[00:02:03]   File "c:\python350-x64\lib\unittest\loader.py", line 219, in loadTestsFromNames
[00:02:03]     suites = [self.loadTestsFromName(name, module) for name in names]
[00:02:03]   File "c:\python350-x64\lib\unittest\loader.py", line 219, in <listcomp>
[00:02:03]     suites = [self.loadTestsFromName(name, module) for name in names]
[00:02:03]   File "c:\python350-x64\lib\unittest\loader.py", line 153, in loadTestsFromName
[00:02:03]     module = __import__(module_name)
[00:02:03]   File "C:\projects\pywikibot-g4xqx\tests\pagegenerators_tests.py", line 16, in <module>
[00:02:03]     from pywikibot import date, pagegenerators
[00:02:03]   File "C:\projects\pywikibot-g4xqx\pywikibot\pagegenerators.py", line 1583, in <module>
[00:02:03]     site: Optional[pywikibot.Site] = None):
[00:02:03]   File "c:\python350-x64\lib\typing.py", line 630, in __getitem__
[00:02:03]     arg = _type_check(arg, "Optional[t] requires a single type.")
[00:02:03]   File "c:\python350-x64\lib\typing.py", line 299, in _type_check
[00:02:03]     raise TypeError(msg + " Got %.100r." % (arg,))
[00:02:03] TypeError: Optional[t] requires a single type. Got <function deprecated_args.<locals>.decorator.<locals>.wrapper at 0x000001224236B620>.
[00:02:03] 
[00:02:03]

Introduced with T239436

Event Timeline

Xqt triaged this task as High priority.Jun 13 2021, 4:26 PM
Xqt added a subscriber: maynorc.

Change 699544 had a related patch set uploaded (by JJMC89; author: JJMC89):

[pywikibot/core@master] [fix] Replace Site factory with APISite class for type

https://gerrit.wikimedia.org/r/699544

Change 699545 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] Fix typing

https://gerrit.wikimedia.org/r/699545

Change 699545 abandoned by Xqt:

[pywikibot/core@master] [bugfix] Fix typing

Reason:

https://gerrit.wikimedia.org/r/699545

Xqt reassigned this task from Xqt to JJMC89.

Change 699544 merged by jenkins-bot:

[pywikibot/core@master] [fix] Replace Site factory with APISite class for type

https://gerrit.wikimedia.org/r/699544