jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/439644 )
Change subject: site_tests.py: Silence the expected UserWarning of TestObsoleteSite ......................................................................
site_tests.py: Silence the expected UserWarning of TestObsoleteSite
Change-Id: I6b79f33b1db0843e246fbc9f970c7ea654ea655b --- M tests/site_tests.py 1 file changed, 10 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index cfaa47e..748b612 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -31,7 +31,7 @@ UnicodeType as unicode, )
-from tests import unittest_print +from tests import patch, unittest_print from tests.aspects import ( unittest, TestCase, DeprecationTestCase, TestCaseBase, @@ -3320,6 +3320,15 @@ }, }
+ @classmethod + def setUpClass(cls): + """Setup the class.""" + with patch.object(pywikibot, 'warn') as warn_mock: + super(TestObsoleteSite, cls).setUpClass() + warn_mock.assert_called_once_with( + 'Site wikipedia:ja instantiated using different code "jp"', + UserWarning, 2) + def test_locked_site(self): """Test Wikimedia closed/locked site.""" site = self.get_site('mhwp')
pywikibot-commits@lists.wikimedia.org