Ñò @¨ Ic @sˆdZddkZddkZddkZddkZddklZddkZddk l Z da dei ifd„ƒYZdS(s³Test related functionality Adds a Pylons plugin to `nose `_ that loads the Pylons app *before* scanning for doc tests. This can be configured in the projects :file:`setup.cfg` under a ``[nosetests]`` block: .. code-block:: ini [nosetests] with-pylons=development.ini Alternate ini files may be specified if the app should be loaded using a different configuration. iÿÿÿÿN(tloadapp(t_get_translatort PylonsPlugincBsAeZdZeZdZdZeid„Z d„Z d„Z RS(súNose plugin extension For use with nose to allow a project to be configured before nose proceeds to scan the project for doc tests and unit tests. This prevents modules from being loaded without a configured Pylons environment. t pylons_configtpylonsc CsVd|iiƒ}|iddƒ|id|id|idddd d d ƒd S( s(Add command-line options for this plugins NOSE_WITH_%st-t_s --with-%stdestttypetstringtdefaulttthelpsKSetup Pylons environment with the config file specified by ATTR [NOSE_ATTR]N(tnametuppertreplacet add_optiont enableOpt(tselftparsertenvtenv_opt((s//usr/lib/python2.6/site-packages/pylons/test.pyt add_options,s cCs]d|_||_t||iƒo4tt||iƒƒ|_t||iƒ|_ndS(sConfigure the pluginN(tNonet config_filetconfthasattrRtbooltgetattrtenabled(RtoptionsR((s//usr/lib/python2.6/site-packages/pylons/test.pyt configure7s   cCs{tiƒ}tiid|ƒtii|ƒtd|i d|ƒ|_ a t t iidƒƒ}t ii|ƒdS(suCalled before any tests are collected or run Loads the application, and in turn its configuration. isconfig:t relative_totlangN(tostgetcwdtsystpathtinsertt pkg_resourcest working_sett add_entryRRtappt pylonsappRRtconfigtgett translatort _push_object(RR%R.((s//usr/lib/python2.6/site-packages/pylons/test.pytbegin?s ( t__name__t __module__t__doc__tFalseRRR R"tenvironRRR0(((s//usr/lib/python2.6/site-packages/pylons/test.pyRs (R3R"R$t nose.pluginstnoseR't paste.deployRRtpylons.i18n.translationRRR+tpluginstPluginR(((s//usr/lib/python2.6/site-packages/pylons/test.pyts