Skip to content

Commit

Permalink
pre-commit and typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Sep 26, 2022
1 parent 86de9be commit 1cf8913
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sphinx:
python:
install:
- method: pip
path: .
path: .
16 changes: 8 additions & 8 deletions testing/test_pluginmanager.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
``PluginManager`` unit and public API testing.
"""
from __future__ import annotations
import pytest
from typing import Any, List
from typing import Any, Callable

from pluggy import (
HookCallError,
Expand Down Expand Up @@ -265,13 +266,12 @@ def test_with_result_memorized(pm: PluginManager, result_callback: bool) -> None
correctly applies the ``result_callback`` function, when provided,
to the result from calling each newly registered hook.
"""
out = []
out: list[int] = []
callback: Callable[[int], None] | None
if not result_callback:
callback = None
else:

def callback(res) -> None:
out.append(res)
callback = out.append

class Hooks:
@hookspec(historic=True)
Expand Down Expand Up @@ -381,7 +381,7 @@ def he_method1(self, arg):
class Plugin1:
@hookimpl
def he_method1(self, arg):
0 / 0
return 0 / 0

pm.register(Plugin1())
with pytest.raises(HookCallError):
Expand Down Expand Up @@ -570,7 +570,7 @@ def my_distributions():


def test_add_tracefuncs(he_pm: PluginManager) -> None:
out: List[Any] = []
out: list[Any] = []

class api1:
@hookimpl
Expand Down Expand Up @@ -623,7 +623,7 @@ def he_method1(self):
raise ValueError()

he_pm.register(api1())
out: List[Any] = []
out: list[Any] = []
he_pm.trace.root.setwriter(out.append)
undo = he_pm.enable_tracing()
try:
Expand Down

0 comments on commit 1cf8913

Please sign in to comment.