Skip to content

Commit 5f08b8d

Browse files
committed
Rely on pytest_perf 0.9 and the new Python syntax.
1 parent 6ed9128 commit 5f08b8d

File tree

3 files changed

+33
-19
lines changed

3 files changed

+33
-19
lines changed

exercises.ini

Lines changed: 0 additions & 18 deletions
This file was deleted.

exercises.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from pytest_perf.deco import extras
2+
3+
4+
@extras('perf')
5+
def discovery_perf():
6+
"discovery"
7+
import importlib_metadata # end warmup
8+
importlib_metadata.distribution('ipython')
9+
10+
11+
def entry_points_perf():
12+
"entry_points()"
13+
import importlib_metadata # end warmup
14+
importlib_metadata.entry_points()
15+
16+
17+
@extras('perf')
18+
def cached_distribution_perf():
19+
"cached distribution"
20+
import importlib_metadata
21+
importlib_metadata.distribution('ipython') # end warmup
22+
importlib_metadata.distribution('ipython')
23+
24+
25+
@extras('perf')
26+
def uncached_distribution_perf():
27+
"uncached distribution"
28+
import importlib
29+
import importlib_metadata
30+
# end warmup
31+
importlib.invalidate_caches()
32+
importlib_metadata.distribution('ipython')

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ testing =
5151
pep517
5252
pyfakefs
5353
flufl.flake8
54-
pytest-perf >= 0.6.2
54+
pytest-perf >= 0.9
5555

5656
docs =
5757
# upstream

0 commit comments

Comments
 (0)