jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/467908 )

Change subject: [test] Enable script_tests for patrol.py
......................................................................

[test] Enable script_tests for patrol.py

- remove patrol from expected_failures list which are expected for -help
  option if external modules aren't present

detached from I4ef9009c91

Change-Id: If323aec472dc54d1df6d8c0f0161692e4a386eb0
---
M scripts/patrol.py
M tests/script_tests.py
2 files changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Dvorapa: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/patrol.py b/scripts/patrol.py
index e72e7ad..2384ed8 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -54,7 +54,10 @@

 from collections import defaultdict

-import mwparserfromhell
+try:
+    import mwparserfromhell
+except ImportError as e:
+    mwparserfromhell = e

 import pywikibot

@@ -126,9 +129,11 @@

     def load_whitelist(self):
         """Load most recent watchlist_page for further processing."""
+        if isinstance(mwparserfromhell, Exception):
+            raise mwparserfromhell
         # Check for a more recent version after versionchecktime in sec.
-        if (self.whitelist_load_ts and (time.time() - self.whitelist_load_ts <
-                                        self.getOption('versionchecktime'))):
+        if (self.whitelist_load_ts and (time.time() - self.whitelist_load_ts
+                                        < self.getOption('versionchecktime'))):
             verbose_output('Whitelist not stale yet')
             return

diff --git a/tests/script_tests.py b/tests/script_tests.py
index af9e37b..055b1e5 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -378,6 +378,7 @@
     # -help tests may pass even when packages are required
     _expected_failures.discard('imageharvest')
     _expected_failures.discard('isbn')
+    _expected_failures.discard('patrol')
     _expected_failures.discard('weblinkchecker')
     _allowed_failures = []


--
To view, visit https://gerrit.wikimedia.org/r/467908
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If323aec472dc54d1df6d8c0f0161692e4a386eb0
Gerrit-Change-Number: 467908
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to