Repository navigation
Commit 1708571
committed
Reduce the slowest test costs without changing production behavior
Profiling with pytest --durations=10 identified four clear outliers:
a debug-toggle test highlighting cmd2's source and three successful-pipe
tests waiting through the production startup probe.
Keep real traceback rendering but suppress source highlighting in the
debug-toggle test. For successful-pipe tests, model the startup probe's
timeout while preserving real subprocess I/O and completion waits.
Early-exit detection remains covered by its separate deterministic test.
Local parallel-run timings (Python 3.14 free-threaded, macOS):
| Test | Before | After |
|---------------------------------|--------|-------|
| test_base_debug | 0.31s | 0.01s |
| test_pipe_to_shell | 0.22s | 0.03s |
| test_piping_uses_utf8 | 0.22s | 0.05s |
| test_pipe_to_shell_and_redirect | 0.21s | 0.05s |
Full-suite parallel time: 3.14s -> 2.61s.
Full-suite serial time: 7.06s -> 6.18s.
The remaining top-ten entries were around 0.05s each and were left intact.
Validation: 1,864 passed, 2 skipped; coverage unchanged at 99.4%.
make check and make docs-test passed.1 parent af7db35 commit 1708571
3 files changed
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
113 | 132 | | |
114 | 133 | | |
115 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
| 846 | + | |
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
| 859 | + | |
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
965 | 968 | | |
966 | 969 | | |
967 | 970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments