Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Apr 4, 2024
1 parent 438f32f commit c0a562c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
7 changes: 4 additions & 3 deletions tests/test_output/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@

# stdlib
from types import MethodType
from typing import Iterable, Optional
from typing import Iterable, Iterator, Optional

# 3rd party
import pytest
from bs4 import BeautifulSoup # type: ignore[import]
from domdf_python_tools.paths import PathPlus
from sphinx.application import Sphinx
from sphinx.testing.path import path
from sphinx.util import logging
from sphinx.util.build_phase import BuildPhase
Expand Down Expand Up @@ -102,7 +103,7 @@ def rootdir():


@pytest.fixture()
def patched_app(app, monkeypatch):
def patched_app(app: Sphinx, monkeypatch) -> Iterable[Sphinx]:

def build(
self,
Expand Down Expand Up @@ -162,7 +163,7 @@ def build(


@pytest.fixture()
def page(patched_app, request) -> BeautifulSoup:
def page(patched_app: Sphinx, request) -> Iterator[BeautifulSoup]:
patched_app.build(force_all=True)

pagename = request.param
Expand Down
9 changes: 2 additions & 7 deletions tests/test_output/test_output.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# stdlib
import sys

# 3rd party
import pytest
import sphinx
from bs4 import BeautifulSoup # type: ignore[import]
from sphinx.application import Sphinx
from sphinx_toolbox.testing import HTMLRegressionFixture


def test_build(patched_app):
def test_build(patched_app: Sphinx):
patched_app.build()
patched_app.build()

Expand Down Expand Up @@ -48,6 +46,3 @@ def test_html_output_autoattrs(page: BeautifulSoup, html_regression: HTMLRegress
div.replace_with(new_tag)

html_regression.check(page, jinja2=True)



4 changes: 2 additions & 2 deletions tests/test_serialise.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# stdlib
from collections import Counter
from enum import IntEnum
from typing import Any, Mapping, MutableMapping, get_type_hints, no_type_check
from typing import Any, Dict, Mapping, MutableMapping, get_type_hints, no_type_check

# 3rd party
import attr
Expand Down Expand Up @@ -232,7 +232,7 @@ def to_dict(self): ...


@register_encoder(HasToDict)
def serialise_attrs(obj: HasToDict):
def serialise_attrs(obj: HasToDict) -> Dict[str, Any]:
return obj.to_dict()


Expand Down

0 comments on commit c0a562c

Please sign in to comment.