Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T52344 Set up unit test running for pywikibot/core | |||
Resolved | jayvdb | T71068 split test suite into tests which depend on a server, and those that do not | |||
Invalid | None | T72936 Important tasks to be solved (tracking) | |||
Resolved | Xqt | T193968 Missing unittests for scripts (tracking) | |||
Resolved | Xqt | T71069 Scripts which are not properly tested by script_tests (tracking) | |||
Resolved | None | T95384 errors in script tests | |||
Resolved | Xqt | T167726 test_imageharvest breaks tests |
Event Timeline
Change 588136 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] Revert "Disable imageharvest tests" and enable tests
Change 588136 merged by jenkins-bot:
[pywikibot/core@master] Revert "Disable imageharvest tests" and enable tests
The new traceback is:
====================================================================== FAIL: test_imageharvest (tests.script_tests.TestScriptSimulate) Test running imageharvest -simulate ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\projects\pywikibot-g4xqx\tests\script_tests.py", line 289, in testScript err_result) AssertionError: u'Traceback (most recent call last)' unexpectedly found in u'From what URL should I get the images? What text should be added at the end of the description of each image from this url? Traceback (most recent call last): File "C:\\projects\\pywikibot-g4xqx\\pwb.py", line 390, in <module> if not main(): File "C:\\projects\\pywikibot-g4xqx\\pwb.py", line 385, in main file_package) File "C:\\projects\\pywikibot-g4xqx\\pwb.py", line 101, in run_python_file main_mod.__dict__) File ".\\scripts\\imageharvest.py", line 153, in <module> main() File ".\\scripts\\imageharvest.py", line 147, in main run_bot(url, image_url, desc) File ".\\scripts\\imageharvest.py", line 97, in run_bot ilinks = get_imagelinks(url) File ".\\scripts\\imageharvest.py", line 56, in get_imagelinks with urlopen(url) as f: AttributeError: addinfourl instance has no attribute \'__exit__\' CRITICAL: Exiting due to uncaught exception <type \'exceptions.AttributeError\'> '
I guess imageharvest fails for Python anyway. A good reason to run tests ;-)
This new bug is related to Python versions prior than 2.7.9, see the doc:
Changed in version 2.7.9: The context parameter was added. All the neccessary certificate and hostname checks are done by default.
In result, imageharvest cannot run with Python 2.7.4
Today it failed tests on Python 2.7.15 with the same traceback like year ago (see the duplicate task)
Change 588145 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Re-enable script test for imageharvest.py
Cannot find the related traceback. But I am wondering about that missing context manager in Python 2.7.17
https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/builds/32122114/job/q26p8k50urv8f4ox?fullLog=true
There is another issue: urllib.basejoin() is used which is not implemented in Python 3 and not imported for Python 2
Change 588145 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Re-enable script test for imageharvest.py