From 8febd7da7746fbaa8a78042d893ffe09eb41ba0a Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 20 Jul 2017 12:52:29 -0400 Subject: [tests] clearer message if test user not defined --- tests/functional/features/environment.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/functional/features/environment.py b/tests/functional/features/environment.py index cc3179e6..b88ddd79 100644 --- a/tests/functional/features/environment.py +++ b/tests/functional/features/environment.py @@ -22,9 +22,13 @@ def before_all(context): context.host = 'https://{}'.format(context.host) context.hostname = urlparse(context.host).hostname - context.username = os.environ['TEST_USERNAME'] - context.password = os.environ['TEST_PASSWORD'] - context.user_email = '{}@{}'.format(context.username, context.hostname) + try: + context.username = os.environ['TEST_USERNAME'] + context.password = os.environ['TEST_PASSWORD'] + context.user_email = '{}@{}'.format(context.username, context.hostname) + except KeyError: + print('TEST_USERNAME or TEST_PASSWORD not set') + sys.exit(0) def _setup_webdriver(context): -- cgit v1.2.3