[py-dev] Call py.test.cmdline.main() from a python script

Ruda Filgueiras rudazz at gmail.com
Wed Nov 30 22:42:47 CET 2005


I'm using py.test to run my unit tests for STOQ 2 [1] project.

To run my tests I can execute py.test script, but I nedd to call
py.test from a python script that initalize database and executes some
doctests using doctest module.

To make this, I add this simple code inside my script:

+import py

My enviroment uses simbolic links from package/module  to a directory
And after using my runtests.py script with these lines, py.test dont
import my test modules correctly. (see traceback log attached)

Anohter member of STOQ2 staff, Johan Dahlin <jdahlin at async.com.br>,
verify the problem and propose a one line patch to this problem, and
I'm send this patch attached too.


1. STOQ2 is a Open Source Reatail System written in python and uses:
- pygtk
- kiwi (MVC framework on top of pygtk)
- SQLObject
- py.test (pylib)
- twisted component model

Rudá Porto Filgueiras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: py_test.patch
Type: text/x-patch
Size: 562 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20051130/a0bfbcc4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: err.log
Type: text/x-log
Size: 29910 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20051130/a0bfbcc4/attachment-0001.bin>

More information about the Pytest-dev mailing list