209: Testing argparse Applications
Listen now
Description
How do you test the argument parsing bit of an application that uses argparse? This episode covers: Design for Test: Structuring your app or script so it's easier to test. pytest & capsys for testing stdout Adding debug and preview flags for debugging and testing And reverting to subprocess.run if you can't modify the code under test Also, there's a full writeup and code samples available: Blog post: Testing argparse Applications  Code Repo The Complete pytest Course For the fastest way to learn pytest, go to courses.pythontest.com Whether your new to testing or pytest, or just want to maximize your efficiency and effectiveness when testing.
More Episodes
Taking notes well can help to listen better, remember things, show respect, be more accountable, free up mind space to solve problems. This episode discusses the benefits of writing things downpreparing for a meetingtaking notes in meetingsreviewing notes for action items, todo items, things to...
Published 11/17/24
In this episode we're talking about importing part of a package into another part of the same package. We'll look at: `from . import module` and `from .module import something` and also:  `import package` to access the external API from with the package. Why would we use `import package` if...
Published 09/07/24
Published 09/07/24