Ñò
@¨ Ic
@ sˆ d Z d d k Z d d k Z d d k Z d d k Z d d k l Z d d k Z d d k l
Z
d a d e i
i f d „ ƒ YZ d S( 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( t loadapp( t _get_translatort PylonsPluginc B sA e Z d Z e Z d Z d Z e i d „ 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_configt pylonsc
C sV d | i i ƒ } | i d d ƒ | i d | i d | i d d d d d
d ƒd S(
s( Add command-line options for this plugins NOSE_WITH_%st -t _s --with-%st destt typet stringt defaultt t helpsK Setup Pylons environment with the config file specified by ATTR [NOSE_ATTR]N( t namet uppert replacet
add_optiont enableOpt( t selft parsert envt env_opt( ( s/ /usr/lib/python2.6/site-packages/pylons/test.pyt add_options, s c C s] d | _ | | _ t | | i ƒ o4 t t | | i ƒ ƒ | _ t | | i ƒ | _ n d S( s Configure the pluginN( t Nonet config_filet conft hasattrR t boolt getattrt enabled( R t optionsR ( ( s/ /usr/lib/python2.6/site-packages/pylons/test.pyt configure7 s
c C s{ t i ƒ } t i i d | ƒ t i i | ƒ t d | i d | ƒ| _
a t t
i i d ƒ ƒ } t
i i | ƒ d S( su Called before any tests are collected or run
Loads the application, and in turn its configuration.
i s config:t relative_tot langN( t ost getcwdt syst patht insertt
pkg_resourcest working_sett add_entryR R t appt pylonsappR R t configt gett
translatort _push_object( R R% R. ( ( s/ /usr/lib/python2.6/site-packages/pylons/test.pyt begin? s ( t __name__t
__module__t __doc__t FalseR R R
R" t environR R R0 ( ( ( s/ /usr/lib/python2.6/site-packages/pylons/test.pyR s ( R3 R" R$ t nose.pluginst noseR' t paste.deployR R t pylons.i18n.translationR R R+ t pluginst PluginR ( ( ( s/ /usr/lib/python2.6/site-packages/pylons/test.pyt s