Running pytest inside emacs results in ugly output

309 views Asked by At

If I run pytest inside of Emacs, using M-X compile, $TERM gets set to "dumb", and this seems to confuse pytest's attempt to draw a line of =s across the full width of the screen. It gets the width one too high, resulting in hard to read output with extra folded lines.

Running unset COLUMNS; pytest helps a little, but it's still trying to do some fancy overwriting by issuing raw carriage-returns, and messing that up. I've also tried setting various values for $TERM (ansi, glass-tty, etc). I even tried, unset TERM.

Any way to convince pytest to just produce dumb output and not try to do any fancy output formatting?

I'm also open to ideas on how to pistol-whip emacs into setting the environment correctly :-)

I'm running:

  • GNU Emacs 22.1.1
  • Python 3.6.2
  • pytest version 3.4.0
  • MacOS 10.12.6 (16G1212)
  • Terminal Version 2.7.3 (388.1.1)
1

There are 1 answers

0
Davor Cubranic On

Try pytest.el, or at least check how it invokes py.test. I use it with Spacemacs (it's included in the Python layer), and have never seen any issues with its terminal handling.