#1177: [PATCH] Allow configuration of unit tests via test.cfg
-------------------------+--------------------------------------------------
 Reporter:  timfreund    |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:           
Component:  unassigned   |     Version:  1.0b1    
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 I just started writing unit tests for my application, and I ran into two
 issues that made support for a test.cfg file desirable.

  * I want to switch between testing with SQLite in memory and PostgreSQL
  * Some configuration properties in app.cfg need to be present for my
 tests to succeed.

 This patch checks for the presence of test.cfg.  If test.cfg exists, the
 following things happen:

  * The module where app.cfg lives is discerned based on the current
 working directory.  This assumes that the tests are run from the root of
 the application directory. (room for improvement)
  * update_config is called, loading test.cfg and app.cfg

 If no test.cfg exists, the default database uri of sqlite:///:memory: is
 used.

 Additionally, cherrypy is not started immediately in testutil.py.  It is
 started only when the first test case is run.  Calling
 cherrypy.server.start right away in an identity enabled application causes
 a problem because cherrypy.root is not yet set:

 AttributeError: 'NoneType' object has no attribute '_cp_filters'

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1177>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to