[py-dev] py.test and python 2.2

holger krekel hpk at trillke.net
Sat Feb 12 23:33:13 CET 2005


Hi Oleg, 

On Sat, Feb 12, 2005 at 22:36 +0300, Oleg Broytmann wrote:
> Hello! I'd like to add a minor patch - to use py.test with python 2.2
> you need to add "from __future__ import generators" to the beginning of
> the py/execnet/channel.py.

Thanks for hinting at this.  Seo Sanghyeon actually also "fixed" 
this at some point and i immediately reverted the patch. 
The thing is that running 'py.test' on the py lib itself 
with this patch generates failing tests :-) 

The underlying problem is (or rather was) that the contents of
channel.py are used in two ways: once for just importing it
and once for making it a part of a larger source code, used
for "gateway" initialization.  See 

    http://codespeak.net/py/current/doc/execnet.html

for some details about gateways.  When you invoke something like 

    py.test --exec=python2.2 

it is really handled by this mechanism which basically 
allows to run tests on different machines as well. 
You did use py.test like this, didn't you? 

The good news is that I now got rid of the shallow 'yield'
usage in favour of an old-style __iter__ implementation.  So
the problem should be gone since rev 9174. 

have fun, 

    holger



More information about the Pytest-dev mailing list