Code Challenge 39 – Writing Tests With Pytest – Review

By on 1 November 2017

In this article we review last week’s Writing Tests With Pytest code challenge.

Submissions

Julian and myself both wrote some tests with pytest for this challenge:

  • hobojoe1848: This is the simplest of the simple. It’s a single PyTest function to test whether the output of a very simple text conversion script works. My first PyTest script ever! Code is here.

  • bbelderbos: First time use of pytest for DB tests, used a fixture, was good learning. Code is here.

pytest is a great tool and writing good tests is a fundamental skill. Also writing code that needs to be tested changes your design for the better.

Given the amount on activity on PyBites we only touched the surface though. Luckily Brian Okken’s great book saved and will save us a lot of time learning the ins and outs of pytest. Julian will also do a quick beginner guide …


Keep Calm and Code in Python!

— Bob and Julian

Want a career as a Python Developer but not sure where to start?