Changeset 5708
- Timestamp:
- 11/18/08 10:38:03 (2 months ago)
- Files:
-
- branches/1.1/turbogears/testutil.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/turbogears/testutil.py
r5696 r5708 42 42 for dirpath, dirs, dummy2 in os.walk('.'): 43 43 basename = os.path.basename(dirpath) 44 dirname = os.path. normpath(os.path.dirname(dirpath))44 dirname = os.path.basename(os.path.dirname(dirpath)) 45 45 init_py = os.path.join(dirpath, '__init__.py') 46 if basename == 'config' and os.path.exists(init_py) and\47 dirname[0] in string.ascii_letters + '_':46 if basename == 'config' and dirname[0] in string.ascii_letters + '_' \ 47 and os.path.exists(init_py): 48 48 modulename = "%s.app" % dirpath[2:].replace(os.sep, ".") 49 49 break 50 50 else: 51 51 modulename = None 52 update_config(configfile="test.cfg", modulename=modulename) 52 # XXX This is a temporary workaround, the code above to find the config 53 # package should really be improved and moved elsewhere. 54 # See http://trac.turbogears.org/ticket/2043 55 try: 56 update_config(configfile="test.cfg", modulename=modulename) 57 except ImportError, exc: 58 import warnings 59 warnings.warn("Could not import configuration from module: %s" % exc, 60 RuntimeWarning) 61 update_config(configfile="test.cfg", modulename=None) 53 62 else: 54 63 database.set_db_uri("sqlite:///:memory:")