Ticket #2043 (closed task: migrated)
Revisit loading of test configuration in turbogears.testutil
|Reported by:||Chris Arndt||Owned by:||faide|
The code in turbogears.testutil to load the configuartion from test.cfg and from the application's config package is very dodgy and should be improved and refactored.
- Code runs on importing the module, which IMHO is not so good. Maybe we should only load the configuration when starting TurboGears in testutil.start_server.
- The code looks through all sub-directories of the current working directory for a Python package named config and, when found, passed this to pkg_resources (via config.update_config), but it doesn't check whether the package is actually on the Python path. This leads to an error when your project directory has a sub-directory (and not below the application's 'package' directory), which contains a config package (which normally is not on the Python path).
- The current code to check whether a potential package directory's filename contains invalid Python identitifier chars is not correct.