Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 19, 2023
1 parent f04c951 commit edf33b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nbconvert/exporters/tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def test_png_metadata(self):
assert len(log.output) == 1
assert "Alternative text is missing on 1 image(s)." in log.output[0]

check_for_png = re.compile(r'<img alt="No description has been provided for this image"([^>]*?)>')
check_for_png = re.compile(
r'<img alt="No description has been provided for this image"([^>]*?)>'
)
result = check_for_png.search(output)
assert result
attr_string = result.group(1)
Expand Down Expand Up @@ -208,18 +210,18 @@ def test_language_code_not_set(self):
(output, resources) = HTMLExporter(template_name="classic").from_filename(
self._get_notebook()
)
assert "<html lang=\"en\">" in output
assert '<html lang="en">' in output

def test_set_language_code(self):
exporter = HTMLExporter(template_name="classic", language_code="fr")
(output, resources) = exporter.from_filename(self._get_notebook())
assert "<html lang=\"fr\">" in output
assert '<html lang="fr">' in output

def test_language_code_error(self):
with self.assertLogs(level="WARN") as log:
exporter = HTMLExporter(template_name="classic", language_code="zz")
assert len(log.output) == 1
assert "\"zz\" is not an ISO 639-1 language code." in log.output[0]
assert '"zz" is not an ISO 639-1 language code.' in log.output[0]
(output, resources) = exporter.from_filename(self._get_notebook())

assert "<html lang=\"en\">" in output
assert '<html lang="en">' in output

0 comments on commit edf33b0

Please sign in to comment.