-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from python/feature/pytest-perf
Use pytest-perf to capture performance expectations and regressions
- Loading branch information
Showing
5 changed files
with
40 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ omit = | |
tests/* | ||
prepare/* | ||
*/_itertools.py | ||
exercises.py | ||
|
||
[report] | ||
show_missing = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ testing = | |
pep517 | ||
pyfakefs | ||
flufl.flake8 | ||
pytest-perf >= 0.9.2 | ||
|
||
docs = | ||
# upstream | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters