[py-dev] Storing terminal width in py.test config object

Floris Bruynooghe flub at devork.be
Mon Jun 25 12:06:07 CEST 2012

On 21 June 2012 07:16, holger krekel <holger at merlinux.eu> wrote:
> On Thu, Jun 21, 2012 at 00:16 +0100, Floris Bruynooghe wrote:
>> An annoyance of the pytest_assertrepr_compare hook is that it can not
>> normally access the terminal width since usually it is called while
>> stdout and stderr are being captured which breaks
>> py.io.get_terminal_width().  Since I think it is fairly rare to get a
>> changing terminal size during a py.test run I would propose py.test
>> stores the terminal width on it's config object which would solve that
>> annoyance.
>> Would this be a reasonable thing to do?
> I think so.  However, I'd like to have this working with xdist as well
> and slaves generally do not have access to the master terminal.
> I guess xdist could take care to explicitely transfer terminal_width
> once it is on the config object. You can leave the latter to me if you prefer.

Ok, as I'm in no hurry on this I've created an issue for this so I
don't completely loose track.  I don't mind attempting to look at
xdist when I get round to it, I probably need to get to know it for my
pytest-timeout plugin anyway.


Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org

More information about the Pytest-dev mailing list