
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
pytest-extra-durations
Advanced tools
A pytest plugin to get durations on a per-function basis and per module basis.
Get more info about the speed of your test suite.
It works with pytest-xdist too.
You can install "pytest-extra-durations" via pip
:
pip install pytest-extra-durations
This plugin provides three types of information.
This can give you more info than the total time displayed by pytest because it's not influenced by the number of workers in pytest-dist, or the collection time.
Exemple:
============== Sum of all tests durations ===============
1.95s
This will be displayed all the time and can't be turned off unless you uninstall this plugin.
This will tell you how much time it took to execute all the tests in a given file.
The API is similar to the one of --durations
in the Pytest CLI.
pytest --modules-durations=4 ./path/to/test/directory
gives:
=============== slowest 4 modules durations =============
1.17s tensorflow_addons/activations/tests/sparsemax_test.py
0.28s tensorflow_addons/activations/tests/gelu_test.py
0.10s tensorflow_addons/activations/tests/softshrink_test.py
0.09s tensorflow_addons/activations/tests/rrelu_test.py
A test function can produce multiple tests, that can be executed on different workers too. This will sum the durations of all tests, setups and teardown produced by a single test function, and report the slower ones.
The API is similar to the one of --durations
in the Pytest CLI.
pytest --functions-durations=4 ./path/to/test/directory
gives:
============ slowest test functions =============
0.99s tensorflow_addons/activations/tests/sparsemax_test.py::test_gradient_against_estimate
0.17s tensorflow_addons/activations/tests/gelu_test.py::test_same_as_py_func
0.09s tensorflow_addons/activations/tests/softshrink_test.py::test_same_as_py_func
0.08s tensorflow_addons/activations/tests/gelu_test.py::test_gelu
0.08s tensorflow_addons/activations/tests/rrelu_test.py::test_theoretical_gradients
Distributed under the terms of the MIT
_ license, "pytest-extra-durations" is free and open source software
FAQs
A pytest plugin to get durations on a per-function basis and per module basis.
We found that pytest-extra-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
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.