Skip to content

Commit

Permalink
Merge pull request #243 from zaneb/list-unconfigured
Browse files Browse the repository at this point in the history
Allow listing of tests with no host configured
  • Loading branch information
cdent committed Apr 16, 2018
2 parents 38ec2da + 0199396 commit 90f33d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gabbi/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def build_tests(path, loader, host=None, port=8001, intercept=None,

# Exit immediately if we have no host to access, either via a real host
# or an intercept.
if not bool(host) ^ bool(intercept):
if not ((host is not None) ^ bool(intercept)):
raise AssertionError(
'must specify exactly one of host or url, or intercept')

Expand Down
4 changes: 3 additions & 1 deletion gabbi/suitemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def make_one_test(self, test_dict, prior_test):
# from a different module.
if self.test_loader_name:
klass.__module__ = self.test_loader_name
check_host = case.testcase.skipIf(not self.host,
'No host configured')

tests = self.loader.loadTestsFromTestCase(klass)
tests = self.loader.loadTestsFromTestCase(check_host(klass))
history[test['name']] = tests._tests[0]
# Return the first (and only) test in the klass.
return tests._tests[0]
Expand Down

0 comments on commit 90f33d0

Please sign in to comment.