Merge pull request #680 from cjmayo/misc

Collection of independent small improvements
This commit is contained in:
Chris Mayo 2022-10-24 19:26:13 +01:00 committed by GitHub
commit b66ca30e84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 12 deletions

View file

@ -157,7 +157,7 @@ Application
.. option:: -D STRING, --debug=STRING
Print debugging output for the given logger.
Available loggers are cmdline, checking, cache, plugin and all.
Available debug loggers are cmdline, checking, cache, plugin and all.
all is an alias for all available loggers.
This option can be given multiple times to debug with more than one logger.

View file

@ -220,10 +220,9 @@ Application
"""""""""""
**debug=**\ *STRING*\ [**,**\ *STRING*...]
Print debugging output for the given modules. Available debug
modules are **cmdline**, **checking**, **cache**, **dns**,
**thread**, **plugins** and **all**. Specifying **all** is an alias
for specifying all available loggers.
Print debugging output for the given logger. Available debug
loggers are **cmdline**, **checking**, **cache**, **plugin** and **all**.
**all** is an alias for all available loggers.
Command line option: :option:`--debug`
Quiet

View file

@ -230,7 +230,7 @@ class TextLogger(_Logger):
self.write(
_n("in %d URL", "in %d URLs", self.stats.num_urls) % self.stats.num_urls
)
self.write(" checked. ")
self.write(_(" checked.") + " ")
warning_text = (
_n("%d warning found", "%d warnings found", self.stats.warnings_printed)
% self.stats.warnings_printed

View file

@ -36,8 +36,7 @@ class TestConfig(TestBase):
"""Test configuration parsing."""
def test_confparse(self):
# Tests must either cover every possiblity or
# use a value other than the default
# Tests must not use the default value only
config = linkcheck.configuration.Configuration()
files = [get_file("config0.ini")]
config.read(files)

View file

@ -45,4 +45,4 @@ class TestDecorators(unittest.TestCase):
return 42
self.assertEqual(f(), 42)
self.assertRegex(log.getvalue(), r"f took 1\.0. seconds")
self.assertRegex(log.getvalue(), r"f took 1\.0\d seconds")

View file

@ -41,9 +41,12 @@ class CustomBuildHook(BuildHookInterface):
committer_date = committer_year = "unknown"
try:
cp = subprocess.run(["git", "log", "-n 1", "HEAD", "--format=%cs"],
capture_output=True, text=True)
except FileNotFoundError:
pass
capture_output=True, check=True, text=True)
except (FileNotFoundError, subprocess.CalledProcessError):
# support building wheel from sdist
if Path(*RELEASE_PY).is_file():
self.app.display_warning("_release.py already exists")
return
else:
if cp and cp.stdout:
committer_date = cp.stdout.strip()