Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1264633?usp=email )
Change subject: Tests: Fix TestProofreadPageValidSite.test_url_image ......................................................................
Tests: Fix TestProofreadPageValidSite.test_url_image
The API response seems not to be deterministic, see also previous fixes.
Bug: T419943 Change-Id: I7fbc59b399e7008cad08ee35e69585297fcffc6b --- M tests/proofreadpage_tests.py 1 file changed, 10 insertions(+), 5 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py index 0afd42d..7b7ec44 100755 --- a/tests/proofreadpage_tests.py +++ b/tests/proofreadpage_tests.py @@ -248,10 +248,14 @@ 'user': 'T. Mazzei', 'header': "{{rh|2|''THE POPULAR SCIENCE MONTHLY.''}}", 'footer': '\n{{smallrefs}}', - 'url_image': ('https://upload.wikimedia.org/wikipedia/commons/' - 'thumb/a/ac/Popular_Science_Monthly_Volume_1.djvu/' - 'page12-2012px-Popular_Science_Monthly_Volume_1.djvu' - '.jpg'), + 'url_image': ( + 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/' + 'Popular_Science_Monthly_Volume_1.djvu/' + 'page12-2012px-Popular_Science_Monthly_Volume_1.djvu.jpg', + 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/' + 'Popular_Science_Monthly_Volume_1.djvu/' + 'page12-1920px-Popular_Science_Monthly_Volume_1.djvu.jpg', + ) }
valid_redlink = { @@ -408,7 +412,8 @@ def test_url_image(self) -> None: """Test fetching of url image of the scan of ProofreadPage.""" page = ProofreadPage(self.site, self.valid['title']) - self.assertEqual(page.url_image, self.valid['url_image']) + # seems the result is not deterministic + self.assertIn(page.url_image, self.valid['url_image']) page = ProofreadPage(self.site, self.existing_unlinked['title']) # test Exception in property. with self.assertRaisesRegex(
pywikibot-commits@lists.wikimedia.org