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

holger krekel holger at merlinux.eu
Thu Jun 21 08:16:48 CEST 2012

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.



> Regards,
> Floris
> -- 
> Debian GNU/Linux -- The Power of Freedom
> www.debian.org | www.gnu.org | www.kernel.org
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev

More information about the Pytest-dev mailing list