Browsed by
Tag: testing

Python: Writing test to verify command line arguments

Python: Writing test to verify command line arguments

I wrote a small Python script that will be executed from the command line. After finishing the tests to verify the business logic, I decided to test the command line arguments as well, just to make sure they’re parsed correctly and passed to their appropriate places in the business logic code. Initially I was thinking I needed to write a test that executes the actual command line such as python3 myscript.py –argument=value, but as this is neither appropriate nor really…

Read More Read More