Skip to content

Commit

Permalink
Using nox session.skip (instead of ValueError) for system tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Jul 18, 2017
1 parent 3625888 commit 7c2d7f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: googleapis/nox:0.11.2
- image: googleapis/nox:0.17.0
steps:
- checkout
- run:
Expand Down
6 changes: 5 additions & 1 deletion nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ def system_tests(session, python_version):
for env_var in SYSTEM_TEST_ENV_VARS:
if env_var not in os.environ:
missing.append(env_var)

# Only run system tests if the environment variables are set.
if missing:
raise ValueError('Environment variable(s) unset', *missing)
all_vars = ', '.join(missing)
msg = 'Environment variable(s) unset: {}'.format(all_vars)
session.skip(msg)

# Run the system tests against latest Python 2 and Python 3 only.
session.interpreter = 'python{}'.format(python_version)
Expand Down

0 comments on commit 7c2d7f1

Please sign in to comment.