jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/422215 )
Change subject: TestSaveFailure.test_nobots: Make sure config.ignore_bot_templates is False ......................................................................
TestSaveFailure.test_nobots: Make sure config.ignore_bot_templates is False
Bug: T190865 Change-Id: I29aa8cd03f1d313dec3ae4ac336b28a1015b4686 --- M tests/edit_failure_tests.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py index 68bda27..64600d3 100644 --- a/tests/edit_failure_tests.py +++ b/tests/edit_failure_tests.py @@ -8,7 +8,7 @@ These tests use special code 'write = -1' for edit failures. """ # -# (C) Pywikibot team, 2014 +# (C) Pywikibot team, 2014-2018 # # Distributed under the terms of the MIT license. # @@ -16,6 +16,7 @@
import pywikibot from pywikibot import ( + config, Error, NoPage, LockedPage, @@ -26,6 +27,7 @@ PageCreatedConflict, )
+from tests import patch from tests.aspects import unittest, TestCase, WikibaseTestCase
@@ -60,7 +62,8 @@ def test_nobots(self): """Test that {{nobots}} raise the appropriate exception.""" page = pywikibot.Page(self.site, 'User:John Vandenberg/nobots') - self.assertRaisesRegex(OtherPageSaveError, 'nobots', page.save) + with patch.object(config, 'ignore_bot_templates', False): + self.assertRaisesRegex(OtherPageSaveError, 'nobots', page.save)
def test_touch(self): """Test that Page.touch() does not do a real edit."""
pywikibot-commits@lists.wikimedia.org