Brian Okken

Developing Software with Tests

Installing Python 3.11 on Mac or Windows

Installing Python from python.org The easiest and most obvious (to me) way to install the latest version of Python on either Mac or Windows is: Go to python.org Hover over the “Downloads” link in the navigation. This will detect if you are on Mac or Windows and present you with a button called “Python 3.11.0” (or whatever the latest version is). Click that button. This downloads an installer. Run the installer....

October 26, 2022 · 4 min

Talk - Sharing is Caring - pytest fixture edition

Sharing is Caring, pytest fixture edition I gave a talk at PyBay 2022 with the above title. It’s about sharing fixtures. The source code, and the slides, are at github.com/okken/pytest_fixture_sharing.

September 10, 2022 · 1 min · Brian

Current Git CLI workflow

Workflow Most of my interactions with git CLI, especially for quick changes, is: $ git checkout main $ git pull $ git checkout -b okken_something < code changes > $ git commit -a -m 'quick message' $ git push Then the code review and merge happen on the server. Commands Let’s break that down. git checkout main Start at the main branch. git pull Grab any changes from remote repo....

April 13, 2022 · 2 min · Brian

Lean TDD

Preface Lean TDD is an attempt to reconcile some conflicting aspects of Test Driven Development and Lean Software Development. I’ve mentioned Lean TDD on the podcast a few times and even tried to do a quick outline at the end of episode 162. This post is a more complete outline, or at least a first draft. In audio form The initial version of this post is also available in audio form as Test & Code, episode 180....

February 20, 2022 · 17 min · Brian

Beta 9.0 of Python Testing with pytest, 2nd ed, available.

The Beta 9.0 is available for Python Testing with pytest, 2nd edition, as of Feb 9, 2022. With this 9th beta release, copy edit and indexing are complete. Next it goes to layout, then to printing. Amazon has it for pre-order, listing March 22 as availability. I think we should be able to hit that. I’m excited.

February 11, 2022 · 1 min · Brian

Python Packaging Struggle for pytest Plugins

Recently, Pradyun posted a tweet commenting not on the state of Python packaging, but more on the state of the documentation and guidance. I'm feeling more and more that realising that a lot of people's frustration with Python Packaging stems from the lack of clear guidance and difficult-to-understand-and-navigate documentation. — Pradyun Gedam (@pradyunsg) September 19, 2021 Now, at the time, I figured that was the case for people new to packaging, not myself....

September 22, 2021 · 2 min

Pinning Application Dependencies with pip-tools compile

pip-tools has more functionality than this, but compile alone is quite useful. Start with a loose list of dependencies in requirements.in: typer rich The requirements.in file can have things like >= and such if you have some restrictions on your dependencies. Now install pip-tools: pip install pip-tools Then, in create a requirements.txt file with compile: pip-compile requirements.in or: python -m piptools compile requirements.in The output will be shown on stdout, but also in requirements....

June 9, 2021 · 1 min

Python Testing with pytest

Simple, Rapid, Effective, and Scalable by Brian Okken Do less work when testing your Python code, but be just as expressive, just as elegant, and just as readable. The pytest testing framework helps you write tests quickly and keep them readable and maintainable—with no boilerplate code. Using a robust yet simple fixture model, it’s just as easy to write small tests with pytest as it is to scale up to complex functional testing for applications, packages, and libraries....

January 12, 2017 · 2 min · Brian

PythonBytes.fm

Michael Kennedy from Talk Python to Me and I have launched a new podcast, called Python Bytes, “Python headlines delivered directly to your earbuds”. It’s a weekly short format podcast. Please check it out. The first few weeks of a podcast can really make a difference if we can get a bunch of listeners to try it right away. Please consider leaving a review on iTunes. Even if you don’t use iTunes to listen, early reviews can really help with visibility....

November 10, 2016 · 1 min · Brian

Transcript for episode 2: Pytest vs Unittest vs Nose

This is the transcript for Test and Code Podcast episode 2 Hello everyone. My name is Brian Okken. Welcome to the Python Test Podcast (Now called “Test & Code”). Today I want to talk about choosing a test framework. When I went to look at the different frameworks, I noticed that unittest and doctest are part of the standard library, but nose and pytest were used quite a bit also, so I figured those four were good things to look into....

September 25, 2016 · 10 min · Brian