[py-dev] requiring options; handling crashes

holger krekel hpk at trillke.net
Sun Jul 2 07:47:54 CEST 2006


Hi Nicholas, 

you have two valid points - but i can't satisfyingly answer 
them right now.  Brief notes: 

* option parsing: please look at py/documentation/conftest.py 
  which adds options.  

* crashing interpreters: indeed, we should think about 
  how to run per-module interpreters.  There are hacks 
  for this (in pypy) but we need to think about a clean
  design. 

best, 

    holger

On Fri, Jun 30, 2006 at 23:59 -0500, Nicholas Riley wrote:
> Hi,
> 
> I am starting a new project and and am attempting to give this
> test-development development thingy a try, so I am starting to use
> py.test.  So far I'm finding it really natural and easy to understand
> - especially compared with my short but unhappy experiences with
> unittest writing tests for the Metakit Python binding.
> 
> I have a few questions.
> 
> First, is there a way to enforce options?  For some of the tests I am
> using Psyco, which does not play happily with py.test without
> --nomagic, so I would like to require this option.  I have tried
> something like this in conftest.py:
> 
> 	import py
> 
> 	py.test.Config.parse(['--nomagic', '--nocapture', '--exitfirst'])
> 
> but that doesn't seem to work, and I'm not sure if there is supposed
> to be a way.
> 
> Second, some of my tests crash the interpreter, so I'd prefer to test
> every file individually (it's fine if no more tests run after the
> crash :).  Is there a sensible way to nest py.test invocations such
> that the results are aggregated?
> 
> If the above aren't possible at the moment, I would be interested in
> implementing them; any hints as to a good design or where the code
> should go would be appreciated.
> 
> -- 
> Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev
> 

-- 
merlinux GmbH       Steinbergstr. 42    31139 Hildesheim   
http://merlinux.de  tel +49 5121 20800 75 (fax 77) 


More information about the py-dev mailing list