diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..75387b2204c6b68eb1fb9c99e7a2e3d97bd6bc71 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +--- +language: python +python: ["2.7", "3.2", "3.3", "3.4", "3.5"] +dist: trusty +sudo: false +cache: + - pip + +install: + - pip install tox-travis + +script: + - tox + +notifications: + email: false diff --git a/tests.sh b/tests.sh index fce6dc9113217902b4d93e15c5d0a304d0ca30ab..859679121b9956c0c18d341a8a269f6a06eaa3ad 100755 --- a/tests.sh +++ b/tests.sh @@ -9,9 +9,10 @@ export name='John' test "$(echo 'Hello {{ name if name is defined else 'world' }}.' | template)" = "Hello John." echo Testing arguments and reading/ writing to file. -echo '{{ USER }}' > "$infile" +echo '{{ name }}' > "$infile" +export name='John' template --output "$outfile" "$infile" -test "$(cat $outfile)" = "$USER" +test "$(cat $outfile)" = "$name" echo Testing JSON parsing. export json='{"a": 1, "b": 2}' diff --git a/tox.ini b/tox.ini index d2b00256d1a0ecf5d6b7f94678fe3a7c4b9df434..30b9980d1bcadf888a89be37879e21f0eaca1c44 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,14 @@ [tox] envlist = py{2,3} +[travis] +python = + 2.7: py2 + 3.2: py3 + 3.3: py3 + 3.4: py3 + 3.5: py3 + [testenv] basepython = py2: python2