diff --git a/.travis.yml b/.travis.yml index 25a4ae81..2ca6545f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,9 @@ matrix: - { stage: test, python: 3.6, env: TOXENV=readme } - { stage: build_and_package_sanity, python: 3.6, env: SANITY_CHECK=1 } +before_install: + - git clone --depth 1 https://github.com/PyCQA/pylint.git + install: - pip install tox-travis - pip install -e .[for_tests] diff --git a/pylint_django/tests/test_func.py b/pylint_django/tests/test_func.py index b8bfbab9..19516219 100644 --- a/pylint_django/tests/test_func.py +++ b/pylint_django/tests/test_func.py @@ -4,8 +4,15 @@ import pytest import pylint -# because there's no __init__ file in pylint/test/ -sys.path.append(os.path.join(os.path.dirname(pylint.__file__), 'test')) + +if pylint.__version__ >= '2.4': + # after version 2.4 pylint stopped shipping the test directory + # as part of the package so we check it out locally for testing + sys.path.append(os.path.join(os.getenv('HOME', '/home/travis'), 'pylint', 'tests')) +else: + # because there's no __init__ file in pylint/test/ + sys.path.append(os.path.join(os.path.dirname(pylint.__file__), 'test')) + import test_functional # noqa: E402 # alter sys.path again because the tests now live as a subdirectory