summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-01-07 23:13:16 -0500
committerJason R. Coombs <jaraco@jaraco.com>2022-01-07 23:13:16 -0500
commit02f788e73556b90f40acf4b08b27411eb6fc8deb (patch)
treee24482aacf30ee05c1abc29fe6957a472d29908c
parent9f37366aab9cd8f6baa23e6a77cfdb8daf97757e (diff)
downloadpython-setuptools-git-feature/distutils-hack-startup-perf.tar.gz
Capture performance of interpreter startup. Ref #3006.feature/distutils-hack-startup-perf
-rw-r--r--exercises.py6
-rw-r--r--setup.cfg1
-rw-r--r--tox.ini2
3 files changed, 9 insertions, 0 deletions
diff --git a/exercises.py b/exercises.py
new file mode 100644
index 00000000..76176be5
--- /dev/null
+++ b/exercises.py
@@ -0,0 +1,6 @@
+def measure_startup_perf():
+ # run by pytest_perf
+ import subprocess
+ import sys # end warmup
+
+ subprocess.check_call([sys.executable, '-c', 'pass'])
diff --git a/setup.cfg b/setup.cfg
index ce7dc5c8..3bf0b618 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -50,6 +50,7 @@ testing =
# workaround for jaraco/skeleton#22
python_implementation != "PyPy"
pytest-enabler >= 1.0.1
+ pytest-perf
# local
mock
diff --git a/tox.ini b/tox.ini
index 07c310bc..d6cc3f56 100644
--- a/tox.ini
+++ b/tox.ini
@@ -15,6 +15,8 @@ extras = testing
passenv =
SETUPTOOLS_USE_DISTUTILS
windir # required for test_pkg_resources
+ # honor git config in pytest-perf
+ HOME
[testenv:integration]
deps = {[testenv]deps}