diff options
| author | ianb <devnull@localhost> | 2005-05-30 20:47:48 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-30 20:47:48 +0000 |
| commit | a236d395fd00cf99e2605bb66613b7b8cadcb69d (patch) | |
| tree | 1057c0dac3a43c78cab2a3d4ec8301e02f27b14f /paste/tests | |
| parent | 189034764abd23901893b201cbeb57a8c8792798 (diff) | |
| download | paste-a236d395fd00cf99e2605bb66613b7b8cadcb69d.tar.gz | |
Make sure import * doesn't require server.conf, as when not used for application acceptance testing
Diffstat (limited to 'paste/tests')
| -rw-r--r-- | paste/tests/fixture.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/paste/tests/fixture.py b/paste/tests/fixture.py index 45b22a1..53dbfbb 100644 --- a/paste/tests/fixture.py +++ b/paste/tests/fixture.py @@ -573,18 +573,19 @@ def setup_module(module): except AttributeError: # No config setup yet start_dir = os.path.abspath(os.path.dirname(module.__file__)) - while not os.path.exists(os.path.join(start_dir, 'server.conf')): - assert start_dir, ( - "server.conf not found (starting from %s" - % module.__file__) + while 1: + if not start_dir or start_dir == os.sep: + break + if os.path.exists(os.path.join(start_dir, 'server.conf')): + server_conf_path = os.path.join(start_dir, 'server.conf') + conf = pyconfig.setup_config( + server_conf_path, add_config={'testing': True}) + app = TestApp(server.make_app(CONFIG.current_conf()), + CONFIG.current_conf()) + module.app = app + module.CONFIG = CONFIG + break start_dir = os.path.dirname(start_dir) - server_conf_path = os.path.join(start_dir, 'server.conf') - conf = pyconfig.setup_config( - server_conf_path, add_config={'testing': True}) - app = TestApp(server.make_app(CONFIG.current_conf()), - CONFIG.current_conf()) - module.app = app - module.CONFIG = CONFIG if hasattr(module, 'reset_state'): module.reset_state() |
