Jacek Generowicz wrote:
> I am working with some code which, for MPI-related reasons, is  
> constructed around a custom-built Python interpreter. I am trying to  
> write some tests for this code using py.test.
>
> Trying to use the --exec option to instruct py.test to use the custom- 
> built Python interpreter in question, results in the following failure.
>
> $ py.test interface/nmag --exec=~/nsim/pyfem3/pyfem3
> inserting into sys.path: /home/jacek/nsim/py
> Traceback (most recent call last):
>    File "/home/jacek/nsim/py/py/bin/py.test", line 4, in ?
>      py.test.cmdline.main()
>    File "/home/jacek/nsim/py/py/test/cmdline.py", line 13, in main
>      session = config.initsession()
>    File "/home/jacek/nsim/py/py/test/config.py", line 140, in  
> initsession
>      session = cls(self)
>    File "/home/jacek/nsim/py/py/test/terminal/remote.py", line 58, in  
> __init__
>      self._setexecutable()
>    File "/home/jacek/nsim/py/py/test/terminal/remote.py", line 70, in  
> _setexecutable
>      assert executable is not None, executable
> AssertionError
>
> Looking at the source code, it is far from clear to me what the  
> problem might be. What sort of values of --exec should I expect to  
> work/fail?
>   
should expect python executable. I happily use --exec like 
--exec=python2.4, --exec=pypy-c. Another way to run it is to run py.test 
under custom executable (we use this with pypy-c), like

~/nsim/pyfem3/pyfem3 py.test interface/nmag


Also my wild guess is that ~ does not get interpreted correctly, because shell 
leaves it alone. Try /home/jacek instead.

> Thanks.
>
> P.S. I'm puzzled by the purpose of ", executable" in line 70 of  
> remote.py: when the assertion fails, executable will always be None,  
> so no message will ever appear.
>   
I'm puzzled as well :)


Cheers,
fijal


:.

_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to