Testing in Python

Part 1: Why you should write unit tests

Photo by Chris Ried on Unsplash

This article series is aimed at people working in the public sector (like me), academics and students, people new to their careers in the private sector and anyone else for whom testing code is not yet second nature. When I refer to “tests” or “testing” in this article the context is constrained to unit and component/modular tests. My experience is mostly derived from building analytical pipelines in Python using pandas and pyspark and testing in pytest.

The series started as a written summary of a presentation given to the Office for National Statistics on Feb 26 2021. …


Testing in Python

Part 3: Testing workflow tips

This article series is aimed at people working in the public sector (like me), academics and students, people new to their careers in the private sector and anyone else for whom testing code is not yet second nature. When I refer to “tests” or “testing” in this article the context is constrained to unit and component/modular tests. My experience is mostly derived from building analytical pipelines in Python using pandas and pyspark and testing in pytest.

The series started as a written summary of a presentation given to the Office for National Statistics on Feb 26 2021. …


Testing in Python

Part 2: Testing basics with pytest

This article series is aimed at people working in the public sector (like me), academics and students, people new to their careers in the private sector and anyone else for whom testing code is not yet second nature. When I refer to “tests” or “testing” in this article the context is constrained to unit and component/modular tests. My experience is mostly derived from building analytical pipelines in Python using pandas and pyspark and testing in pytest.

The series started as a written summary of a presentation given to the Office for National Statistics on Feb 26 2021. …


Testing in Python

Writing out rows of test data can be tedious and boring, even if just a few lines. But mastering a few keyboard shortcuts in VS Code can make it fun. You’ll feel like a wizard and your friends will be impressed. So let’s get started…

Move Lines — [ALT + Up/Down Arrow]

Move any selection of lines up or down

Copy Lines — [SHIFT + ALT + Up/Down Arrow]

Mitch Edmunds

Building statistical pipelines for the ONS. Writing about testing and API design in pandas and PySpark. Enjoy cycling, learning Portuguese and playing piano!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store