Change cwd test to use a tempdir

Many system users will not have a homedir, or will
have this value set to `/dev/null`, which will break this
test.  Instead we'll just create a tempdir and cd to that instead.
Fix flake8 issues
Merge branch 'skip-if-dev-null' into develop

* skip-if-dev-null:
  Fix flake8 issues
  Change cwd test to use a tempdir