A difficult read, I admit. In essence: misspelled only throws an exception if the terminal is a tty.

So: assert that terminal is not a tty. Otherwise, simply "Assert False" -- because this line of code was reached, wrongly, with the statement "Should have thrown exception".