diff --git a/.travis.yml b/.travis.yml index 0d07079ece25ee8cc4550e39d76df7cc2f444b3e..34c476c17af9bcc10a789ea221120cd8159feaeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,16 @@ --- language: python -python: ["2.7", "3.3", "3.4", "3.5"] +python: ["2.7", "3.2", "3.3", "3.4", "3.5"] dist: trusty sudo: false cache: - pip +matrix: + include: + - python: "3.5" + env: TOXENV=docs + allow_failures: + - python: "3.2" install: - pip install tox-travis diff --git a/README.rst b/README.rst index e222e914faa295104a99ae3462634b54d58d053c..ffb12a41ed08f44cc88537fe6d26332a1f7422da 100644 --- a/README.rst +++ b/README.rst @@ -46,7 +46,8 @@ The following Jinja filters were added: - :code:`pprint`: Pretty print variable. - :code:`combine`: Combine 2 dictionaries. -Example usage can be seen in :code:`tests.sh`. +Example usage can be seen in :code:`tests.sh` and for specific filters in the +docstrings in :code:`template/filters.py`. Testing ------- @@ -79,6 +80,8 @@ at: https://www.shore.co.il/git/. TODO ---- +- Fix test failure on Python 3.2 + (https://travis-ci.org/adarnimrod/template/jobs/194581463). - Release on tagged commits to PyPI in Travis CI (https://docs.travis-ci.com/user/deployment/pypi/ and https://docs.travis-ci.com/user/encryption-keys/). diff --git a/template/filters.py b/template/filters.py index 133ecbbbaac71916a11b84475754b02490eed07d..a98d0ef30e6acb243ec0aade71c357699128adb5 100644 --- a/template/filters.py +++ b/template/filters.py @@ -47,9 +47,9 @@ def from_json(value): >>> from_json('[1, 2, 3]') [1, 2, 3] - >>> from_json('"a"') == six.text_type(u'a') + >>> from_json('"a"') == six.text_type('a') True - >>> from_json('{"1": {"a": [1, 2, 3]}}') == {u'1': {u'a': [1, 2, 3]}} + >>> from_json('{"1": {"a": [1, 2, 3]}}') == {'1': {'a': [1, 2, 3]}} True ''' from json import loads diff --git a/tox.ini b/tox.ini index ab86304e8a82c503e9937d09e25c4baf70b99c68..4bd8d644c8ef0caf346721f085c88929fd92108d 100644 --- a/tox.ini +++ b/tox.ini @@ -19,11 +19,15 @@ deps = flake8 commands = check-manifest --ignore tox.ini,tests* - python setup.py check -m -r -s flake8 . python -m doctest template/filters.py template/__init__.py ./tests.sh +[testenv:docs] +basepython = python +deps = readme_renderer +commands = python setup.py check -m -r -s + [testenv:release] basepython = python whitelist_externals =