Skip to content

Commit

Permalink
Fix typing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Sep 11, 2022
1 parent b93fea6 commit 5c32de6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/avalanche_pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from avalanche.callgrind_wrapper import lib


def pytest_addoption(parser: pytest.Parser):
def pytest_addoption(parser: "pytest.Parser"):
group = parser.getgroup("avalanche performance measurement")
group.addoption(
"--benchmark",
Expand All @@ -20,7 +20,7 @@ def pytest_addoption(parser: pytest.Parser):
)


def pytest_configure(config: pytest.Config):
def pytest_configure(config: "pytest.Config"):
config.addinivalue_line(
"markers", "avalanche_benchmark: mark an entire test for avalanche benchmarking"
)
Expand All @@ -30,12 +30,14 @@ def pytest_configure(config: pytest.Config):


@pytest.fixture(scope="session")
def _is_benchmark_enabled(request: pytest.FixtureRequest) -> bool:
def _is_benchmark_enabled(request: "pytest.FixtureRequest") -> bool:
return request.config.getoption("--benchmark")


@pytest.fixture
def callbench(request: pytest.FixtureRequest, _is_benchmark_enabled: bool) -> Callable:
def callbench(
request: "pytest.FixtureRequest", _is_benchmark_enabled: bool
) -> Callable:
def run(func: Callable[..., Any], *args: Any):
if _is_benchmark_enabled:
lib.zero_stats()
Expand Down

0 comments on commit 5c32de6

Please # to comment.