pytest-icdiff icon indicating copy to clipboard operation
pytest-icdiff copied to clipboard

pytest-icdiff causes hangs when terminal width is zero

Open jclerman opened this issue 3 years ago • 2 comments

I have found that in certain CI environments (CircleCI), terminal width is reported as zero, which seems to cause pytest-icdiff to hang (stops producing output and does not exit) when pytest finds an error. I don't have a compact reproducible example unfortunately (I can experiment with trying to make one), but hopefully it'll be helpful to have this report nonetheless (it took quite a while to sleuth out this much).

The problem occurs with pytest 7.1.3 and 7.2.0, under python 3.8.15 and python 3.9.10 (I haven't tested with other combinations). It occurs with pytest-icdiff 0.5 and 0.6.

The problem can be avoided by running stty rows 50 cols 120 before starting pytest but one has to know to do that.

jclerman avatar Jan 12 '23 09:01 jclerman

It would be helpful to add --cols to the list of possible arguments since the CI environment won't know a useful width anyway, maybe along with a few other arguments icdiff has. Currently, the default behaviour is simply hardwired, while icdiff is more flexible than that.

PeterNerlich avatar Jan 31 '23 20:01 PeterNerlich

thanks very much for reporting! even if i don't get round to fixing it immediately, at least people might be able to google the problem now and find your suggested workaround. much appreciated.

hjwp avatar Feb 02 '23 10:02 hjwp