Hi Simon, I'm doing just that by importing the "py" package, and invoking py.test with:
>>>py.test.cmdline.main([]]) The argument to the "main" function is a python list of the arguments you would pass at the shell prompt. I've been able to debug using pydev/eclipse. Stu ________________________________________ From: py-dev-boun...@codespeak.net [py-dev-boun...@codespeak.net] On Behalf Of Simon Callan [simon.cal...@infoshare-is.com] Sent: May 11, 2010 12:38 PM To: py-dev@codespeak.net Subject: Re: [py-dev] Setup and teardown functions Hi, > 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. Simon Infoshare Ltd Millennium House 21 Eden Street Kingston upon Thames Surrey KT1 1BL United Kingdom Phone: + 44 (0) 20 8541 0111 Support: + 44 (0) 20 8481 4760 Web: www.infoshare-is.com E-mail: i...@infoshare-is.com Infoshare Ltd is registered in England and Wales. Registered Office as above. Registered Number 2877612 VAT Number GB 678 1443 10 The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way. Infoshare Ltd monitors incoming and outgoing e-mails. Please consider the environment. Do you really need to print this email? _______________________________________________ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev _______________________________________________ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev