adding more alternatives as asked for by bluebird75

--HG--
branch : trunk
This commit is contained in:
holger krekel 2009-11-02 14:52:54 +01:00
parent e584892c12
commit 4dd6c7679d
1 changed files with 12 additions and 3 deletions

View File

@ -125,7 +125,7 @@ and implement the `parametrization scheme of your choice`_.
py.test interaction with other packages py.test interaction with other packages
=============================================== ===============================================
What's up with multiprocess on Windows? Issues with py.test, multiprocess and setuptools?
------------------------------------------------------------ ------------------------------------------------------------
On windows the multiprocess package will instantiate sub processes On windows the multiprocess package will instantiate sub processes
@ -133,14 +133,23 @@ by pickling and thus implicitely re-import a lot of local modules.
Unfortuantely, setuptools-0.6.11 does not ``if __name__=='__main__'`` Unfortuantely, setuptools-0.6.11 does not ``if __name__=='__main__'``
protect its generated command line script. This leads to infinite protect its generated command line script. This leads to infinite
recursion when running a test that instantiates Processes. recursion when running a test that instantiates Processes.
There are two workarounds: There are these workarounds:
* `install Distribute`_ as a drop-in replacement for setuptools * `install Distribute`_ as a drop-in replacement for setuptools
and re-install py.test and install py.test
* `directly use a checkout`_ which avoids all setuptools/Distribute * `directly use a checkout`_ which avoids all setuptools/Distribute
installation installation
If those options are not available to you, you may also manually
fix the script that is created by setuptools by inserting an
``if __name__ == '__main__'``. Or you can create a "pytest.py"
script with this content and invoke that with the python version::
import py
if __name__ == '__main__':
py.cmdline.pytest()
.. _`directly use a checkout`: install.html#directly-use-a-checkout .. _`directly use a checkout`: install.html#directly-use-a-checkout
.. _`install distribute`: http://pypi.python.org/pypi/distribute#installation-instructions .. _`install distribute`: http://pypi.python.org/pypi/distribute#installation-instructions