Skip to content

Commit

Permalink
chore: automated black/isort formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and abelcheung committed Apr 14, 2024
1 parent b8fc4c3 commit eafb9ca
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
1 change: 0 additions & 1 deletion lxml-stubs/etree/_parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class _FeedParser(Generic[_ET_co]):
```
"""
...

@deprecated("Removed since 5.0; renamed to set_element_class_lookup()")
def setElementClassLookup(
self, lookup: ElementClassLookup | None = None
Expand Down
2 changes: 1 addition & 1 deletion test-rt/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def h2_filepath() -> Path:

@pytest.fixture
def h2_fileuri(h2_filepath: Path) -> str:
return 'file:///' + str(h2_filepath)
return "file:///" + str(h2_filepath)


@pytest.fixture
Expand Down
12 changes: 8 additions & 4 deletions test-rt/test_beautifulsoup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

reveal_type = getattr(_testutils, "reveal_type_wrapper")


class TestFromstring:
# fmt: off
@_testutils.signature_tester(_soup.fromstring, (
Expand Down Expand Up @@ -211,10 +212,13 @@ def test_bs_args(self, h2_fileuri: str) -> None:

class TestConvertTree:
# fmt: on
@_testutils.signature_tester(_soup.convert_tree, (
("beautiful_soup_tree", Parameter.POSITIONAL_OR_KEYWORD, Parameter.empty),
("makeelement" , Parameter.POSITIONAL_OR_KEYWORD, None ),
)) # fmt: off
@_testutils.signature_tester(
_soup.convert_tree,
(
("beautiful_soup_tree", Parameter.POSITIONAL_OR_KEYWORD, Parameter.empty),
("makeelement", Parameter.POSITIONAL_OR_KEYWORD, None),
),
) # fmt: off
def test_func_sig(self) -> None:
pass

Expand Down
7 changes: 1 addition & 6 deletions test-rt/test_constants.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import _testutils
import lxml.ElementInclude as _ei
import lxml.etree as _e
import lxml.html as _h
import lxml.isoschematron as _sch
import lxml.objectify as _o
import lxml.ElementInclude as _ei

reveal_type = getattr(_testutils, "reveal_type_wrapper")


class TestEtreeConstants:

def test_ver_const(self) -> None:
reveal_type(_e.LIBXML_COMPILED_VERSION)
reveal_type(_e.LIBXML_VERSION)
Expand All @@ -25,7 +24,6 @@ def test_other_const(self) -> None:


class TestSchematronConstants:

def test_ns_const(self) -> None:
reveal_type(_sch.RELAXNG_NS)
reveal_type(_sch.SCHEMATRON_NS)
Expand All @@ -34,20 +32,17 @@ def test_ns_const(self) -> None:


class TestObjectifyConstants:

def test_all_const(self) -> None:
reveal_type(_o.__version__)
reveal_type(_o.PYTYPE_ATTRIBUTE)


class TestHtmlConstants:

def test_ns_const(self) -> None:
reveal_type(_h.XHTML_NAMESPACE)


class TestElemIncludeConstants:

def test_xinc_const(self) -> None:
reveal_type(_ei.XINCLUDE)
reveal_type(_ei.XINCLUDE_FALLBACK)
Expand Down
1 change: 0 additions & 1 deletion test-rt/test_errorlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def test_container_behavior(self, list_log: _ListErrorLog) -> None:


class TestListLogMethods:

# fmt: off
@_testutils.signature_tester(_ListErrorLog.filter_domains, (
None,
Expand Down
9 changes: 4 additions & 5 deletions test-rt/test_xinclude.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def test_xinclude_as_func(self, xinc_sample_data: str) -> None:
@overload
def good_loader(
href: str, mode: Literal["xml"], encoding: str | None = None
) -> _Element: ...
) -> _Element:
...


@overload
def good_loader(
href: str, mode: Literal["text"], encoding: str | None = None
) -> str: ...
def good_loader(href: str, mode: Literal["text"], encoding: str | None = None) -> str:
...


def good_loader(href: str, mode: str, encoding: str | None = None) -> Any:
Expand All @@ -93,7 +93,6 @@ def bad_loader_3(href: str, mode: str, _) -> _Element:


class TestElementInclude:

# fmt: off
@_testutils.signature_tester(EI.include, (
('elem' , _ParameterKind.POSITIONAL_OR_KEYWORD, Parameter.empty),
Expand Down

0 comments on commit eafb9ca

Please sign in to comment.