Skip to content

Commit 412bc8c

Browse files
committed
Fix some pre-commit.
1 parent 7a09196 commit 412bc8c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/psc/resources.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
from psc.here import HERE
1818
from psc.here import PYODIDE
1919

20+
2021
EXCLUSIONS = ("pyscript.css", "pyscript.js", "favicon.png")
2122

2223

2324
def tag_filter(
24-
tag: Tag,
25-
exclusions: tuple[str, ...] = EXCLUSIONS,
25+
tag: Tag,
26+
exclusions: tuple[str, ...] = EXCLUSIONS,
2627
) -> bool:
2728
"""Filter nodes from example that should not get included."""
2829
attr = "href" if tag.name == "link" else "src"

tests/examples/test_interest_calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_calculator_setup(
3030
from psc.gallery.examples.interest_calculator.calculator import setup
3131

3232
fake_document.values["calc"] = "Calculate"
33-
setup()
33+
setup() # type: ignore
3434
node = fake_document.nodes["calc"]
3535
assert "Removed disabled" == node.element.log[0]
3636

tests/test_resources.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
import pytest
66
from bs4 import BeautifulSoup
77

8-
from psc.resources import Example, get_sorted_examples
8+
from psc.resources import Example
99
from psc.resources import Page
1010
from psc.resources import get_body_content
1111
from psc.resources import get_head_nodes
1212
from psc.resources import get_resources
13+
from psc.resources import get_sorted_examples
1314
from psc.resources import is_local
1415
from psc.resources import tag_filter
1516

17+
1618
IS_LOCAL = is_local()
1719

1820

@@ -116,8 +118,8 @@ def test_example() -> None:
116118
this_example = Example(path=PurePath("hello_world"))
117119
assert this_example.title == "Hello World"
118120
assert (
119-
this_example.subtitle
120-
== "The classic hello world, but in Python -- in a browser!"
121+
this_example.subtitle
122+
== "The classic hello world, but in Python -- in a browser!"
121123
)
122124
assert "hello_world.css" in this_example.extra_head
123125
assert "<h1>Hello ...</h1>" in this_example.body
@@ -153,6 +155,7 @@ def test_missing_page() -> None:
153155

154156

155157
def test_sorted_examples() -> None:
158+
"""Ensure a stable listing."""
156159
examples = get_sorted_examples()
157160
first_example = examples[0]
158161
assert "altair" == first_example.name
@@ -167,8 +170,8 @@ def test_get_resources() -> None:
167170
hello_world = resources.examples[hello_world_path]
168171
assert hello_world.title == "Hello World"
169172
assert (
170-
hello_world.subtitle
171-
== "The classic hello world, but in Python -- in a browser!"
173+
hello_world.subtitle
174+
== "The classic hello world, but in Python -- in a browser!"
172175
)
173176

174177
# Page

0 commit comments

Comments
 (0)