Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1167

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
args: [--quiet]
exclude: plot_syntaxerror
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.282
rev: v0.0.284
hooks:
- id: ruff
- repo: https://github.com/codespell-project/codespell
Expand Down
4 changes: 2 additions & 2 deletions sphinx_gallery/gen_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,9 +1139,9 @@ def generate_file_rst(fname, target_dir, src_dir, gallery_conf, seen_backrefs=No
if not executable:
dummy_image = file_conf.get("dummy_images", None)
if dummy_image is not None:
if type(dummy_image) is not int:
if isinstance(dummy_image, bool) or not isinstance(dummy_image, int):
raise ExtensionError(
"sphinx_gallery_dummy_images setting is not a number, "
"sphinx_gallery_dummy_images setting is not an integer, "
"got {dummy_image!r}"
)

Expand Down
2 changes: 1 addition & 1 deletion sphinx_gallery/tests/test_gen_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def test_dummy_image_error(gallery_conf, req_pil):
content_image = CONTENT + [
"# sphinx_gallery_dummy_images=False",
]
msg = "sphinx_gallery_dummy_images setting is not a number"
msg = "sphinx_gallery_dummy_images setting is not an integer"
with pytest.raises(ExtensionError, match=msg):
_generate_rst(gallery_conf, "test.py", content_image)

Expand Down