I have a Python module that uses the argparse library. How do I write tests for that section of the code base?
Populate your arg list by using sys.argv.append() and then call
parse(), check the results and repeat.
Call from a batch/bash file with your flags and a dump args flag.
Put all your argument parsing in a separate file and in the if __name__ == "__main__": call parse and dump/evaluate the results then test this from a batch/bash file.
How do you write tests for the argparse portion of a python module?