jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/467971 )
Change subject: [test] Do not try to load the whitelist ......................................................................
[test] Do not try to load the whitelist
detached from I4ef9009c91
Change-Id: Ia4bf26cc5600fc190dbc54fa4d56501410da8e05 --- M tests/patrolbot_tests.py 1 file changed, 11 insertions(+), 5 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/patrolbot_tests.py b/tests/patrolbot_tests.py index 17be8a1..6bd23e6 100644 --- a/tests/patrolbot_tests.py +++ b/tests/patrolbot_tests.py @@ -8,10 +8,7 @@ from __future__ import absolute_import, division, unicode_literals
-try: - from scripts import patrol -except ImportError: - patrol = None # if mwparserfromhell is not installed +from scripts import patrol
from tests.aspects import require_modules, unittest, DefaultDrySiteTestCase
@@ -32,6 +29,15 @@ """
+class DummyPatrolBot(patrol.PatrolBot): + + """Dummy Patrol Bot for Tests.""" + + def load_whitelist(self): + """Do not try to load the whitelist.""" + pass + + @require_modules('mwparserfromhell') class TestPatrolBot(DefaultDrySiteTestCase):
@@ -40,7 +46,7 @@ def setUp(self): """Create a bot dummy instance.""" super(TestPatrolBot, self).setUp() - self.bot = patrol.PatrolBot(self.site) + self.bot = DummyPatrolBot(self.site)
def test_parse_page_tuples(self): """Test parsing the page tuples from a dummy text."""