Recent posts

Python: Covering all your bases with Coverage

June 17, 2020

Test Driven Development (TDD) in Python touched on TDD and pytest. Then in Taking pytest for a test drive we dived deeper on both subjects. Now that we’ve got those two covered off, it’s time to talk about pytest-cov. In a nutshell, pytest-cov tells us how much of our code base is covered by our tests. This is useful because as our project grow...

Taking pytest for a test drive

June 16, 2020

In the previous post we got a glimpse of pytest. In this post, we’ll be diving a little deeper. To do this, we’ll be build a basic Flask app. Before we start coding though, let’s first set up our directory structure. Thankfully, pytest gives us a few examples in their Directory Structure and Good Practices pages. For the purposes of this post,...

Test Driven Development (TDD) in Python

June 15, 2020

Have you heard of Test Driven Development (TDD)? If you haven’t, you’re in for a real treat. TDD is a development methodology. Before writing a new function or method, a dev will write a “test” for it. The test’s job is to ensure the code produces the correct output. As the code does not yet exist, the test will of course fail the first time i...

Learn Python: Dissecting Netmiko - Part 3

June 14, 2020

This is the third post in this series. If you missed Part 2, you can find it here. Dissecting platforms Though it appears platforms is only 2 lines: 1 2 platforms = list(CLASS_MAPPER.keys()) platforms.sort() There’s actually a lot more to it. Let’s take a look at what I mean. First, we see it refers to CLASS_MAPPER 1 platforms = list(...

Writing clean Python using Black

June 08, 2020

There are two important methodologies which can be used to assist you in writing clean, maintainable code. They are: Style Guides Test Driven Development (TDD) In this series of posts we’ll cover what they are and how to set them up. Style Guides If you’ve been coding for any amount of time, you’ve likely heard of PEP8 - Style Guide for...