Xqt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352172 )

Change subject: [pep9] Keep lines of script_tests.py beneath 80 chars
......................................................................

[pep9] Keep lines of script_tests.py beneath 80 chars

Change-Id: I34b5710d761dd75ef101c441845c7d0cd57dbe25
---
M tests/script_tests.py
1 file changed, 20 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/72/352172/1

diff --git a/tests/script_tests.py b/tests/script_tests.py
index 2766bf0..255552f 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -17,7 +17,8 @@
 )
 
 from tests import join_root_path
-from tests.aspects import unittest, DefaultSiteTestCase, MetaTestCaseClass, 
PwbTestCase
+from tests.aspects import (unittest, DefaultSiteTestCase, MetaTestCaseClass,
+                           PwbTestCase)
 from tests.utils import allowed_failure, execute_pwb, add_metaclass
 
 scripts_path = join_root_path('scripts')
@@ -100,7 +101,9 @@
     'catall': 'q\n',  # q for quit
     'editarticle': 'Test page\n',
     'imageuncat': 'q\n',
-    'imageharvest': 
'https://upload.wikimedia.org/wikipedia/commons/8/80/Wikipedia-logo-v2.svg\n\n',
+    'imageharvest':
+        'https://upload.wikimedia.org/wikipedia/commons/'
+        '8/80/Wikipedia-logo-v2.svg\n\n',
     'interwiki': 'Test page that should not exist\n',
     'misspelling': 'q\n',
     'pagefromfile': 'q\n',
@@ -108,7 +111,9 @@
                                   # Enter to begin, Enter for default summary.
     'shell': '\n',  # exits on end of stdin
     'solve_disambiguation': 'Test page\nq\n',
-    'upload': 
'https://upload.wikimedia.org/wikipedia/commons/8/80/Wikipedia-logo-v2.svg\n\n\n',
+    'upload':
+        'https://upload.wikimedia.org/wikipedia/commons/'
+        '8/80/Wikipedia-logo-v2.svg\n\n\n',
 }
 
 auto_run_script_list = [
@@ -149,7 +154,8 @@
     'featured': '0 pages written.',
     'freebasemappingupload': 'Cannot find ',
     'harvest_template': 'ERROR: Please specify',
-    'imageuncat': 'WARNING: This script is primarily written for Wikimedia 
Commons',
+    'imageuncat':
+        'WARNING: This script is primarily written for Wikimedia Commons',
     # script_input['interwiki'] above lists a title that should not exist
     'interwiki': 'does not exist. Skipping.',
     'imageharvest': 'From what URL should I get the images',
@@ -234,15 +240,19 @@
 
     """Test meta class."""
 
+    _GLOBAL_ARG = 'Global arguments available for all'
+
     def __new__(cls, name, bases, dct):
         """Create the new class."""
         def test_execution(script_name, args=[]):
-            is_autorun = '-help' not in args and script_name in 
auto_run_script_list
+            is_autorun = ('-help' not in args and
+                          script_name in auto_run_script_list)
 
             def test_skip_script(self):
                 raise unittest.SkipTest(
                     'Skipping execution of auto-run scripts (set '
-                    'PYWIKIBOT2_TEST_AUTORUN=1 to enable) 
"{0}"'.format(script_name))
+                    'PYWIKIBOT2_TEST_AUTORUN=1 to enable) "{0}"'
+                    .format(script_name))
 
             def testScript(self):
                 cmd = [script_name]
@@ -270,8 +280,8 @@
                 if not hasattr(self, 'net') or not self.net:
                     test_overrides['pywikibot.Site'] = 'None'
 
-                result = execute_pwb(cmd, data_in, timeout=timeout, 
error=error,
-                                     overrides=test_overrides)
+                result = execute_pwb(cmd, data_in, timeout=timeout,
+                                     error=error, overrides=test_overrides)
 
                 stderr = result['stderr'].splitlines()
                 stderr_sleep = [l for l in stderr
@@ -296,8 +306,7 @@
                                       stderr_other)
                         self.assertNotIn('-help', args)
                     else:
-                        self.assertIn('Global arguments available for all',
-                                      result['stdout'])
+                        self.assertIn(_GLOBAL_ARG, result['stdout'])
 
                     exit_codes = [0]
                 else:
@@ -319,7 +328,7 @@
                 self.assertNotIn('deprecated', result['stderr'].lower())
 
                 # If stdout doesnt include global help..
-                if 'Global arguments available for all' not in 
result['stdout']:
+                if _GLOBAL_ARG not in result['stdout']:
                     # Specifically look for deprecated
                     self.assertNotIn('deprecated', result['stdout'].lower())
                     if result['stdout'] == '':

-- 
To view, visit https://gerrit.wikimedia.org/r/352172
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34b5710d761dd75ef101c441845c7d0cd57dbe25
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to