Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/806878 )

Change subject: [tests] update coverage
......................................................................

[tests] update coverage

- remove flags from codecov.yml
- exclude make_dist.py
- use # pragma: no cover to exclude some code

Change-Id: I2a36aab0c0db230cff0f6471d40445391e49834b
---
M .codecov.yml
M pywikibot/data/api/_login.py
M pywikibot/data/memento.py
M pywikibot/scripts/shell.py
M pywikibot/userinterfaces/terminal_interface_win32.py
5 files changed, 8 insertions(+), 31 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved



diff --git a/.codecov.yml b/.codecov.yml
index 1742cae..af8ecaf 100644
--- a/.codecov.yml
+++ b/.codecov.yml
@@ -10,15 +10,6 @@
     project:
       default:
         enabled: yes
-      framework:
-        flags:
-          - framework
-      tests:
-        flags:
-          - tests
-      scripts:
-        flags:
-          - scripts
     patch:
       default:
         enabled: yes
@@ -27,6 +18,7 @@
         enabled: yes

   ignore:
+    - make_dist.py
     - pywikibot/backports.py
     - pywikibot/daemonize.py
     - pywikibot/families/__init__.py
@@ -50,19 +42,3 @@
     gitter:
       default:
         url: https://webhooks.gitter.im/e/f312b840da1c40d9f4be
-
-flags:
-  framework:
-    carryforward: true
-    paths:
-      - pywikibot
-
-  tests:
-    carryforward: true
-    paths:
-      - tests
-
-  scripts:
-    carryforward: true
-    paths:
-      - scripts
diff --git a/pywikibot/data/api/_login.py b/pywikibot/data/api/_login.py
index db90c01..cedc9a7 100644
--- a/pywikibot/data/api/_login.py
+++ b/pywikibot/data/api/_login.py
@@ -95,7 +95,7 @@
             # try to login
             try:
                 login_result = login_request.submit()
-            except pywikibot.exceptions.APIError as e:
+            except pywikibot.exceptions.APIError as e:  # pragma: no cover
                 login_result = {'error': e.__dict__}

             # clientlogin response can be clientlogin or error
@@ -115,7 +115,7 @@

             if status in ('NeedToken', 'WrongToken', 'badtoken'):
                 token = response.get('token')
-                if token and self.below_mw_1_27:
+                if token and self.below_mw_1_27:  # pragma: no cover
                     # fetched token using action=login
                     login_request['lgtoken'] = token
                     pywikibot.log('Received login token, proceed with login.')
@@ -170,5 +170,5 @@
         if 'query' in login_token_result:
             return login_token_result['query']['tokens'].get('logintoken')

-        self.below_mw_1_27 = True
+        self.below_mw_1_27 = True  # pragma: no cover
         return None
diff --git a/pywikibot/data/memento.py b/pywikibot/data/memento.py
index ecaf35e..9d2e0a1 100644
--- a/pywikibot/data/memento.py
+++ b/pywikibot/data/memento.py
@@ -169,7 +169,7 @@
                     timeout=timeout
                 )
             except (requests.exceptions.ConnectTimeout,
-                    requests.exceptions.ConnectionError):
+                    requests.exceptions.ConnectionError):  # pragma: no cover
                 warning('Could not connect to URI {}, returning no native '
                         'URI-G'.format(original_uri))
                 return None
diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py
index b267b7f..ae36d81 100755
--- a/pywikibot/scripts/shell.py
+++ b/pywikibot/scripts/shell.py
@@ -48,7 +48,7 @@
     code.interact("""Welcome to the Pywikibot interactive shell!""", local=env)


-if __name__ == '__main__':
+if __name__ == '__main__':  # pragma: no cover
     if sys.platform == 'win32':
         import platform
         import subprocess
diff --git a/pywikibot/userinterfaces/terminal_interface_win32.py 
b/pywikibot/userinterfaces/terminal_interface_win32.py
index f1f9f66..c3a3454 100644
--- a/pywikibot/userinterfaces/terminal_interface_win32.py
+++ b/pywikibot/userinterfaces/terminal_interface_win32.py
@@ -38,7 +38,8 @@
     def __init__(self) -> None:
         """Initializer."""
         super().__init__()
-        if PYTHON_VERSION == (3, 5):  # issue1602 solved in Python 3.6
+        # issue1602 solved in Python 3.6
+        if PYTHON_VERSION == (3, 5):  # pragma: no cover
             from pywikibot.userinterfaces import win32_unicode
             stdin, stdout, stderr, argv = win32_unicode.get_unicode_console()
             self.stdin = stdin

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/806878
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2a36aab0c0db230cff0f6471d40445391e49834b
Gerrit-Change-Number: 806878
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to