Open mgorny opened 7 years ago
Huh. On my SSD based system, warm cache, probably no py.test plugins installed:
$ time py.test --help >/dev/null
real 0m0.274s
user 0m0.242s
sys 0m0.031s
Some of us are still running 5400 RPM spinning disks. And anyway, you can't really rely on people ensuring that the system is 100% idle when running tests. Some systems just have to deal with constant load.
However, in this particular case it seems to be actually CPU-busy.
$ time py.test --version
This is pytest version 3.0.6, imported from /usr/lib64/python3.5/site-packages/pytest.py
setuptools registered plugins:
pytest-timeout-1.2.0 at /usr/lib64/python3.5/site-packages/pytest_timeout.py
pytest-subtesthack-0.1.1 at /usr/lib64/python3.5/site-packages/pytest_subtesthack.py
pytest-pep8-1.0.6 at /usr/lib64/python3.5/site-packages/pytest_pep8.py
pytest-mock-1.6.0 at /usr/lib64/python3.5/site-packages/pytest_mock.py
pytest-localserver-0.3.7 at /usr/lib64/python3.5/site-packages/pytest_localserver/plugin.py
pytest-httpbin-0.2.3 at /usr/lib64/python3.5/site-packages/pytest_httpbin/plugin.py
pytest-cov-2.3.1 at /usr/lib64/python3.5/site-packages/pytest_cov/plugin.py
hypothesis-3.6.1 at /usr/lib64/python3.5/site-packages/hypothesis/extra/pytestplugin.py
betamax-0.8.0 at /usr/lib64/python3.5/site-packages/betamax/fixtures/pytest.py
backports.unittest-mock-1.2.1 at /usr/lib64/python3.5/site-packages/backports/unittest_mock/__init__.py
real 0m7,461s
user 0m7,368s
sys 0m0,387s
Sure, I'm not relying on anything. Just surprised to see especially almost two orders of magnitude slower warm cache times, they sound like something's wrong or misbehaving. My system isn't exactly new either, it's a 2012 i7 laptop.
FWIW I just tested with the same set of plugins as you have in a freshly created virtualenv:
$ time py.test --version
This is pytest version 3.1.3, imported from /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest.py
setuptools registered plugins:
pytest-timeout-1.2.0 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_timeout.py
pytest-subtesthack-0.1.1 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_subtesthack.py
pytest-pep8-1.0.6 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_pep8.py
pytest-mock-1.6.2 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_mock.py
pytest-localserver-0.3.7 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_localserver/plugin.py
pytest-httpbin-0.2.3 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_httpbin/plugin.py
pytest-cov-2.5.1 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/pytest_cov/plugin.py
hypothesis-3.14.0 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/hypothesis/extra/pytestplugin.py
betamax-0.8.0 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/betamax/fixtures/pytest.py
backports.unittest-mock-1.3 at /home/scop/workspace/pyenv/versions/3.6.2/envs/testing/lib/python3.6/site-packages/backports/unittest_mock/__init__.py
real 0m0.956s
user 0m0.882s
sys 0m0.073s
Started removing plugins one by one, and have a hunch that the largest contributor to startup time was removal of pytest-httpbin.
xtrace:
time needed for cold cache
py.test --help
:Warm cache gets it down to ~8s. It's probably related to loading py.test plugins.