Don't leave stray file if test fails.
As assert aborts the code execution if the file exists, this test will result in the file not being deleted if it exists. This change makes sure the file is cleaned up if it exists, before the assert has a chance to abort.
Added tests for #451.
If isTTY is falsey (i.e. empty), the cli will attempt to read from stdin even if it is passed an input filename.
Don't rely on isTTY for reading from stdin. Fixes #451.
Actually isTTY is only relevant if we want to see whether we really have to read from stdin.