git diff with pytest

git diff with pytest

July 30, 2025

I heard this while listening to Test and Code. Brian was talking to Adam Johnson.

$ pytest $(git diff --name-only *tests*)

I can see using this as a good way to only run changed tests.