The line between unit and integration is blurry. Just test what you need to for confidence.
I’d do it all in Python:
- set up the temporary directory with pathlib / pytest’s
tmp_path
fixture - run your command with
subprocess.run
, or just by callingmain
- assert on the file contents using pathlib API