Testing, Debugging and Profiling
unittest, doctest, pdb, timeit, cProfile, pstats and tracemalloc.
Easy
This is an overview — pick a sub-topic below.
Sub-topics (6)
unittest
The built-in xUnit-style test framework.
Easy♥ 0🔖 0💬 0
doctest
Tests written as interactive examples inside docstrings.
Easy♥ 0🔖 0💬 0
pdb
The interactive debugger: breakpoints, stepping and inspecting variables.
Easy♥ 0🔖 0💬 0
timeit
Time small code snippets accurately.
Beginner♥ 0🔖 0💬 0
cProfile and pstats
Profile which functions take the most time.
Intermediate♥ 0🔖 0💬 0
tracemalloc
Track where memory is allocated to find leaks.
Intermediate♥ 0🔖 0💬 0
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.