Skip to content

Commit

Permalink
Complete type annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Aug 26, 2021
1 parent 2c7f803 commit 698f151
Show file tree
Hide file tree
Showing 18 changed files with 666 additions and 352 deletions.
4 changes: 2 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
]


def pytest_configure():
def pytest_configure() -> None:
remove_importlib_metadata()


def remove_importlib_metadata():
def remove_importlib_metadata() -> None:
"""
Because pytest imports importlib_metadata, the coverage
reports are broken (#322). So work around the issue by
Expand Down
14 changes: 7 additions & 7 deletions exercises.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
from pytest_perf.deco import extras


@extras('perf')
def discovery_perf():
@extras('perf') # type: ignore[misc]
def discovery_perf() -> None:
"discovery"
import importlib_metadata # end warmup

importlib_metadata.distribution('ipython')


def entry_points_perf():
def entry_points_perf() -> None:
"entry_points()"
import importlib_metadata # end warmup

importlib_metadata.entry_points()


@extras('perf')
def cached_distribution_perf():
@extras('perf') # type: ignore[misc]
def cached_distribution_perf() -> None:
"cached distribution"
import importlib_metadata

importlib_metadata.distribution('ipython') # end warmup
importlib_metadata.distribution('ipython')


@extras('perf')
def uncached_distribution_perf():
@extras('perf') # type: ignore[misc]
def uncached_distribution_perf() -> None:
"uncached distribution"
import importlib
import importlib_metadata
Expand Down

0 comments on commit 698f151

Please sign in to comment.