Skip to content

Commit

Permalink
tests: clone pylint locally for CI. Fixes #250
Browse files Browse the repository at this point in the history
Pylint 2.4.0 (pylint-dev/pylint@33b8185) removed the 'test' module from
its package and this broke our tests. Clone the sources locally
and adjust the paths so that CI continues to work.
  • Loading branch information
atodorov committed Oct 30, 2019
1 parent d00dafb commit adc0e1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -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]
Expand Down
11 changes: 9 additions & 2 deletions pylint_django/tests/test_func.py
Expand Up @@ -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.getenv('HOME'), '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
Expand Down

0 comments on commit adc0e1e

Please sign in to comment.