* factor out duplicated code
* make tests an importable package
* idiomatic pytest usage
* do not touch files outside of the tmp test tree and do not depend on
external state (except for /nix/store ☹)
* run coverage to root out dead code
It seems unlikely that the “without” case will have any errors that the
“with” case doesn’t, but it’s still a common use case and easy enough to
parametrize.