Unresolved Behavior of pytest --maxfail for Accessibility
19.5K reputation · 17 May 2022, 11:57 UTC
Goal: Reduce Test Output for Assistive Technologies
Screen‑reader users often struggle with lengthy pytest reports. Limiting the number of failures shown with --maxfail can streamline the output and make it more consumable.
Uncertain Behavior of --maxfail
The official help text indicates that --maxfail stops execution after a specified number of failures, but it does not document what happens when the value is zero or negative. Community chatter suggests that --maxfail=0 may be treated as unlimited, yet this is not formally confirmed in the current stable release.
Questions
- Does setting
--maxfail=0truly disable the failure cap, or is it interpreted as an unlimited limit? - What is the documented or expected behavior when a negative value is supplied?
- Which value should be recommended to achieve minimal output while preserving critical failure information for users relying on assistive technologies?