
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
pytest-durations
Advanced tools
Pytest plugin to measure fixture and test durations.
In order to get the pure test setup/teardown durations, the plugin subtracts time taken by fixtures whose scope is larger than "function".
In comparison to the built-in pytest "--durations", this plugin shows fixture durations separately from test function durations and supports xdist and time-traveling packages.
$ pip install pytest-durations
pytest-durations:
--pytest-durations=N Show N slowest setup/test durations (N=0 to disable
plugin). Default 30
--pytest-durations-min=N
Minimal duration in seconds for inclusion in slowest
list. Default 0.005
--pytest-durations-log=FILE
Result log filename or dash for terminal output. Default
"-"
--pytest-durations-group-by={legacy,module,class,function}
Group test durations by module, class, or function. Use
legacy grouping for backward compatibility. Default:
"function"
Note: Please don't confuse these options with the --durations options that come from pytest itself.
========================================= fixture duration top ==========================================
total name num med min
0:00:00.031589 tests/test_options.py::fake_pluginmanager 3 0:00:00.008776 0:00:00.008076
0:00:00.015807 tests/test_xdist.py::fake_session 2 0:00:00.007904 0:00:00.007442
0:00:00.014311 tests/test_options.py::fake_config 2 0:00:00.007155 0:00:00.007126
0:00:00.009118 tests/test_plugin.py::test_plugin_with_options::pytester 3 0:00:00.002232 0:00:00.002049
0:00:00.005009 tests/test_options.py::reload_module 1 0:00:00.005009 0:00:00.005009
0:00:00.096780 grand total 164 0:00:00.000016 0:00:00.000010
======================================== test call duration top =========================================
total name num med min
0:00:00.483961 tests/test_plugin.py::test_plugin_xdist_enabled 1 0:00:00.483961 0:00:00.483961
0:00:00.177326 tests/test_plugin.py::test_plugin_with_options 3 0:00:00.057389 0:00:00.057286
0:00:00.067949 tests/test_plugin.py::test_plugin_with_resultlog 1 0:00:00.067949 0:00:00.067949
0:00:00.066597 tests/test_plugin.py::test_plugin_disable 1 0:00:00.066597 0:00:00.066597
0:00:00.059509 tests/test_plugin.py::test_plugin_xdist_disabled 1 0:00:00.059509 0:00:00.059509
0:00:00.025053 tests/test_ticker.py::test_freezegun_import_none 1 0:00:00.025053 0:00:00.025053
0:00:00.023706 tests/test_ticker.py::test_get_current_ticks_frozen 2 0:00:00.011853 0:00:00.000215
0:00:00.912538 grand total 78 0:00:00.000083 0:00:00.000050
======================================== test setup duration top ========================================
total name num med min
0:00:00.019535 tests/test_options.py::test_pytest_addoption 1 0:00:00.019535 0:00:00.019535
0:00:00.016147 tests/test_options.py::test_pytest_configure_disabled 1 0:00:00.016147 0:00:00.016147
0:00:00.015358 tests/test_options.py::test_pytest_configure 1 0:00:00.015358 0:00:00.015358
0:00:00.010575 tests/test_plugin.py::test_plugin_with_options 3 0:00:00.002773 0:00:00.002462
0:00:00.008763 tests/test_xdist.py::test_pytest_sessionfinish_noxdist 1 0:00:00.008763 0:00:00.008763
0:00:00.007749 tests/test_xdist.py::test_pytest_sessionfinish 1 0:00:00.007749 0:00:00.007749
0:00:00.100089 grand total 78 0:00:00.000113 0:00:00.000052
====================================== test teardown duration top =======================================
total name num med min
0:00:00.006716 grand total 78 0:00:00.000062 0:00:00.000044
The project uses poetry for dependency management, pytest for testing, and pre-commit for coding standard checks.
$ pip install poetry
$ poetry install
$ pre-commit install
$ pytest
--pytest-durations-group-by=none option that preserves the full test node ID, including parametersTo revert to the old behavior for test and fixture names in reports, set the --pytest-durations-group-by option to "legacy".
FAQs
Pytest plugin reporting fixtures and test functions execution time.
We found that pytest-durations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.