From 5fdeabb5cbc30677d5d03f93f319ac9117df4ffa Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Sun, 11 Oct 2015 12:03:07 +0100 Subject: [PATCH] Update and move a comment to reflect reality Early on the comment was true: If there was no host or intercept an empty suite would be returned. This proved to mask errors in test creation in large testing systems so a more visible and immediate failure was implemented. The comment, however, did not get updated. Now it is. --- gabbi/driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gabbi/driver.py b/gabbi/driver.py index 3b16734..07cc9a1 100644 --- a/gabbi/driver.py +++ b/gabbi/driver.py @@ -202,6 +202,8 @@ def build_tests(path, loader, host=None, port=8001, intercept=None, :rtype: TestSuite containing multiple TestSuites (one for each YAML file). """ + # Exit immediately if we have no host to access, either via a real host + # or an intercept. if not (bool(host) ^ bool(intercept)): raise AssertionError('must specify exactly one of host or intercept') @@ -219,8 +221,6 @@ def build_tests(path, loader, host=None, port=8001, intercept=None, for handler in RESPONSE_HANDLERS + response_handlers: handler(case.HTTPTestCase) - # Return an empty suite if we have no host to access, either via - # a real host or an intercept for test_file in glob.iglob(yaml_file_glob): if intercept: host = str(uuid.uuid4())