Skip to content

Commit de517dd

Browse files
committed
* consolidate tox testenv command boilerplate
* add testenv that does not pass through or set any environment variables to ensure that local tests work without them
1 parent 730b25d commit de517dd

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ matrix:
3434
env: TOXENV=py36-accept
3535
- python: 3.6
3636
env: TOXENV=py36-examples
37+
- python: 3.6
38+
env: TOXENV=nocmk
3739
# disabling Bandit run in Travis pending resolution of https://bugs.launchpad.net/bandit/+bug/1749603
3840
# - python: 3.6
3941
# env: TOXENV=bandit

tox.ini

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{27,34,35,36}-{local,integ,accept,examples},
3+
py{27,34,35,36}-{local,integ,accept,examples}, nocmk,
44
bandit, doc8, readme, docs,
55
{flake8,pylint}{,-tests,-examples},
66
vulture
@@ -18,6 +18,9 @@ envlist =
1818
# test-release :: Builds dist files and uploads to testpypi pypirc profile.
1919
# release :: Builds dist files and uploads to pypi pypirc profile.
2020

21+
[testenv:base-command]
22+
commands = pytest --basetemp={envtmpdir} -l --cov aws_encryption_sdk {posargs}
23+
2124
[testenv]
2225
passenv =
2326
# Identifies AWS KMS key id to use in integration tests
@@ -29,11 +32,18 @@ passenv =
2932
sitepackages = False
3033
deps = -rtest/requirements.txt
3134
commands =
32-
local: pytest --cov aws_encryption_sdk -m local -l {posargs}
33-
integ: pytest --cov aws_encryption_sdk -m integ -l {posargs}
34-
accept: pytest --cov aws_encryption_sdk -m accept -l {posargs}
35-
all: pytest --cov aws_encryption_sdk -l {posargs}
36-
examples: pytest --cov examples/test/ -m examples -l {posargs}
35+
local: {[testenv:base-command]commands} -m local
36+
integ: {[testenv:base-command]commands} -m integ
37+
accept: {[testenv:base-command]commands} -m accept
38+
all: {[testenv:base-command]commands}
39+
examples: {[testenv:base-command]commands} -m examples
40+
41+
# Verify that local tests work without environment variables present
42+
[testenv:nocmk]
43+
basepython = python3
44+
sitepackages = False
45+
deps = -rtest/requirements.txt
46+
commands = {[testenv:base-command]commands} -m local
3747

3848
# Linters
3949
[testenv:flake8]

0 commit comments

Comments
 (0)