Closed ngreenwald closed 3 years ago
The /private thing is a Mac OS specific folder location. On my machine it always appends it, testing via github never appends it.
Got it. What about testing the code in the __main__
block? I realized that in my first couple PRs I never changed where get_arg_parser
was being imported from, so the code would have failed if someone tried to run it. I could just put it all in a function and test the function? Or is there a way to have pytest look at it as is?
We don't currently have a great way to test functions outside of the module.
We can pull more code into import-able functions and test those, but I think we're OK as-is.
Yeah, good point. I switched the logic so that argparsing and running happens separately in the top level function
We currently don't test the argparse functionality in the repo. This PR moves the argparse function to utils and adds testing to make sure parameters are passed appropriately, and that errors are raised when required.
For the
if __main__
code that's left inrun_app.py
, we could probably test that if we put it all in a function and that function got called within the block? Let me know what you think.