On Tue, May 11, 2010 at 17:38 +0100, Simon Callan wrote:
> > i attach an initial solution as a tar.gz file:
> >
> > * tests/conftest.py : the per-project file to put your configuration
> > and test setup machinery in
> > * tests/test_module1.py a test module with a test function and a test
> method
> > * tests/test_module2.py another test module for demo purposes
> ...
> > Please let me know if this makes sense to you.
>
> This appears to be just what I wanted, and what I was slowly groping toward
> myself.
>
> I now have another question.
>
> Normally, py.test is started using the executable. Is it possible to start
> it from a python script? This would make it a lot easier to debug the test
> scripts, as I could set breakpoints, etc using PyDev.
In principle you can put this in a script:
import py
py.test.cmdline.main()
or if you want to repeatedly run tests in the same process you
may use this helper function:
https://bitbucket.org/hpk42/py-trunk/src/tip/contrib/runtesthelper.py
I also just committed a fix that makes the runtesthelper script
unneccessary - so in >=1.3.1 you will just be able to call
py.test.cmdline.main() multiple times in the same process.
best,
holger
_______________________________________________
py-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/py-dev