pytest: Expand test inputs using dynamic fixtures

When writing tests in Python, I always choose the pytest test framework. It is concise, feature-rich has a great ecosystem of plugins, is widely used, and supported in the community. One aspect which makes it blend seamlessly with the code under test is how test input can be passed to it. Within this part of the usual arrange-act-assert structure of tests, let’s explore one particular feature: parametrization. Accompanying example Before we dive into pytest, let’s build a concrete example to eventually write tests for....

June 30, 2020 · 7 min · Carsten Rösnick-Neugebauer

From Python to Rust: First Impressions

I did a lot of systems programming in the last couple of months. In Python. Time to explore how I would do that in a language that is closer to the system yet brings guarantees I’d love to have in Python as well: Rust. But what are the core concepts, how does Rust code feel like? Let’s find out. Motivation A good share of my recent work involves building libraries in Python around proprietary communication protocols that handle data retrieval, decoding, validation, and proper error handling....

June 18, 2020 · 11 min · Carsten Rösnick-Neugebauer

Dockerize a Ruby application

In this post, I describe my journey from knowing essentially nothing about Docker to having a dockerized Padrino application with each service living in a container (more on that below). To find this guide useful, you’d need to have Ruby installed, but no prior experience with Docker. We begin with the very basics: ensuring that Docker and docker-compose are installed, creating a minimal Docker setup, and generating a new toy Padrino application within its container....

November 12, 2016 · 10 min · Carsten Rösnick-Neugebauer