Welcome to jamsek.dev

Feel free to navigate the site via the menu on the left.

Latest blog post:

Unit testing with pytest—not easily ignored

July 20, 2019

Not as easy as advertised!

Days 10–12 of the 100 Days of Code course from TalkPython is dedicated to unit testing with pytest, and has been a plenitude of information. Prior to this, I had very little experience with pytest and found it less intuitive than the language itself—at least at first. And I think this was due to trying to sophisticate the actual tests; rather than hardcoding the input and expected output of a given test for a function with the parametrize decorator, I would essentially try to rewrite the function logic in a different way to reproduce the expected output. This, however, is counterintuitive because you’re introducing another possibility for faulty logic, albeit in your test, so if your tests pass but both models are flawed, you’d never know. That, and I was testing a command-line driven app, so figuring out

Continue reading