Suggest Anthony's solution for testing argparse
#43
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
good first issue
Good for newcomers
At PyCon 23 I was suggested 📺 a video by @asottile who shows how to easily get back the control that
argparse
takes away from you. Two tricks, which ultimately make it unnecessary to mocksys.argv
and use theshell
function this project provides.argv
variable to the argument parser'sparse_args()
function.capsys
fixture to evaluatestdout
andstderr
.Suggested Changes
argparse
example project template could be adjusted to incorporate this idea.The text was updated successfully, but these errors were encountered: