Testing with Python 3.12

Python 3.12.0a2 is out. So now may be a great time to get your projects to start testing against 3.12. Note about alpha releases of Python This is from the same link as above: “During the alpha phase, features may be added up until the start of the beta phase (2023-05-08) and, if necessary, may be modified or deleted up until the release candidate phase (2023-07-31). Please keep in mind that this is a preview release and its use is not recommended for production environments....

December 5, 2022 · 3 min · Brian

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. }} -- Now, at the time, I figured that was the case for people new to packaging, not myself. I’m not really an old timer with packaging, but: I have a few published packages. I’ve used both Flit and setuptools. I’ve interviewed Brett Cannon 3 times on the packaging in episodes of Test & Code....

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

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