Refactor to avoid needing to patch `sys.argv`
ajm188 opened this issue · 2 comments
evhub commented
Not a big deal, but if you make this change the testing becomes slightly less end-to-end, since if there's a mistake telling argparse
to grab sys.argv
, that would never be caught.
ajm188 commented
True.
However, I would argue that a test that uses a mock isn't really an end to end test, since it wouldn't catch if there was some code that messed with sys.argv
before argparse
got its hands on it (which is basically what mock
does).
Of course, this would never happen in practice, but I doubt we would not catch a change that told argparse
to grab something other than sys.argv
in production.