Get the latest tech news

Making PyPI's test suite faster


See how we slashed PyPI’s test suite runtime from 163 to 30 seconds. The techniques we share can help you dramatically improve your own project’s testing performance without sacrificing coverage.

Our previous posts have focused on features like digital attestations and Trusted Publishing, but today we’ll look at a equally critical aspect of holistic software security: test suite performance. Below, we’ll explore the systematic approach we took to achieve these improvements, starting with the highest-impact changes and working through to the finer optimizations that collectively transformed the testing experience for PyPI contributors. BeforeAfterImprovementTest execution time191s63s67% reductionThis single optimization delivered most of our performance gains while requiring relatively few code changes, demonstrating the importance of addressing architectural bottlenecks before fine-tuning individual components.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of PyPI

PyPI

Photo of test suite

test suite

Photo of Trail of Bits Blog

Trail of Bits Blog

Related news:

News photo

Malicious PyPi package hides RAT malware, targets Discord devs since 2022

News photo

Carding tool abusing WooCommerce API downloaded 34K times on PyPI

News photo

Python's PyPI Finally Gets Closer to Adding 'Organization Accounts' and SBOMs