Use more pytest fixtures

Use pytest `tmpdir` in the unit tests rather than `tempfile`

Closes #130