summaryrefslogtreecommitdiff
path: root/paste/tests
diff options
context:
space:
mode:
Diffstat (limited to 'paste/tests')
-rw-r--r--paste/tests/fixture.py23
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()