jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/766232 )
Change subject: [tests] update code coverage ......................................................................
[tests] update code coverage
Change-Id: Iab4330da6ab36c6591452a926a8181d5d240db55 --- M .codecov.yml M .coveragerc M pywikibot/comms/http.py M pywikibot/data/mysql.py M pywikibot/scripts/generate_family_file.py 5 files changed, 16 insertions(+), 10 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/.codecov.yml b/.codecov.yml index 3314ceb..0875e32 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -16,8 +16,6 @@ ignore: - pywikibot/backports.py - pywikibot/daemonize.py - - pywikibot/families/__init__.py - - scripts/archive/ - scripts/userscripts/ - scripts/maintenance/colors.py - scripts/maintenance/make_i18n_dict.py @@ -25,7 +23,6 @@ - scripts/maintenance/sorting_order.py - scripts/maintenance/update_linktrails.py - scripts/maintenance/wikimedia_sites.py - - tests/archive/ - tests/pwb/
notify: diff --git a/.coveragerc b/.coveragerc index aa2a510..6b2d060 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,15 @@ [report] +ignore_errors = True +skip_empty = True + exclude_lines = # Have to re-enable the standard pragma pragma: no cover raise NotImplementedError if .PYWIKIBOT_TEST_.*. in os.environ: + @(abc.)?abstractmethod + @deprecated([^)]+) + +omit = */archive/* + +include = */scripts/version.py \ No newline at end of file diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index ad635a0..8fb7b03 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -78,7 +78,7 @@
# Prepare flush on quit -def flush(): +def flush(): # pragma: no cover """Close the session object. This is called when the module terminates.""" log('Closing network session.') session.close() diff --git a/pywikibot/data/mysql.py b/pywikibot/data/mysql.py index 87117cd..3952570 100644 --- a/pywikibot/data/mysql.py +++ b/pywikibot/data/mysql.py @@ -33,7 +33,7 @@ .. versionadded:: 7.0 """
- def close(self): + def close(self): # pragma: no cover """Send the quit message and close the socket.""" if self._closed or self._sock is None: super().close() diff --git a/pywikibot/scripts/generate_family_file.py b/pywikibot/scripts/generate_family_file.py index ad004d8..2af8ae3 100755 --- a/pywikibot/scripts/generate_family_file.py +++ b/pywikibot/scripts/generate_family_file.py @@ -27,7 +27,7 @@ folder of your base directory instead of pywikibot/families. """ # -# (C) Pywikibot team, 2010-2021 +# (C) Pywikibot team, 2010-2022 # # Distributed under the terms of the MIT license # @@ -88,7 +88,7 @@ self.wikis = {} # {'https://wiki/$1': Wiki('https://wiki/$1'), ...} self.langs = [] # [Wiki('https://wiki/$1'), ...]
- def get_params(self): + def get_params(self): # pragma: no cover """Ask for parameters if necessary.""" if self.base_url is None: self.base_url = input('Please insert URL to wiki: ') @@ -115,7 +115,7 @@ for verify in (True, False): try: w = self.Wiki(self.base_url, verify=verify) - except FatalServerError: + except FatalServerError: # pragma: no cover print('ERROR: ' + pywikibot.comms.http.SSL_CERT_VERIFY_FAILED_MSG) pywikibot.exception() @@ -153,7 +153,7 @@ try: self.langs = w.langs print(' '.join(sorted(wiki['prefix'] for wiki in self.langs))) - except Exception as e: + except Exception as e: # pragma: no cover self.langs = [] print(e, '; continuing...')
@@ -203,7 +203,7 @@ try: self.wikis[key] = self.Wiki(lang['url']) print('downloaded') - except Exception as e: + except Exception as e: # pragma: no cover print(e) else: print('in cache')
pywikibot-commits@lists.wikimedia.org