tests: Avoid side effect of COLUMNS env var (#9813)
Several tests rely on getting the default width of a terminal for
rendering test output. Some PTY environments (in my case the Emacs
shell) set the env var `COLUMNS` to the terminal width, which can
cause several tests to fail due to formatting mismatches.
Prior to running thesee tests, mock out `sys.environ`, removing the
`COLUMNS` env var when present.