Skip to content

Commit

Permalink
Rely on pytest_perf 0.9 and the new Python syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 26, 2021
1 parent 6ed9128 commit 5f08b8d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
18 changes: 0 additions & 18 deletions exercises.ini

This file was deleted.

32 changes: 32 additions & 0 deletions exercises.py
@@ -0,0 +1,32 @@
from pytest_perf.deco import extras


@extras('perf')
def discovery_perf():
"discovery"
import importlib_metadata # end warmup
importlib_metadata.distribution('ipython')


def entry_points_perf():
"entry_points()"
import importlib_metadata # end warmup
importlib_metadata.entry_points()


@extras('perf')
def cached_distribution_perf():
"cached distribution"
import importlib_metadata
importlib_metadata.distribution('ipython') # end warmup
importlib_metadata.distribution('ipython')


@extras('perf')
def uncached_distribution_perf():
"uncached distribution"
import importlib
import importlib_metadata
# end warmup
importlib.invalidate_caches()
importlib_metadata.distribution('ipython')
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -51,7 +51,7 @@ testing =
pep517
pyfakefs
flufl.flake8
pytest-perf >= 0.6.2
pytest-perf >= 0.9

docs =
# upstream
Expand Down

0 comments on commit 5f08b8d

Please sign in to comment.