diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index c70f2b2d..2e434a5f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -171,6 +171,11 @@ jobs: cd ${{ github.workspace }}/opencv python modules/python/test/test.py -v --repo . + - name: Pylint test + run: | + python -m pip install pylint + python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 3711e1b3..46ecb631 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -106,6 +106,11 @@ jobs: cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + - name: Pylint test + run: | + arch -arm64 python${{ matrix.python-version }} -m pip install pylint + arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0262c7b8..cee1d848 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -130,6 +130,12 @@ jobs: python modules\python\test\test.py -v --repo . shell: cmd + - name: Pylint test + run: | + python -m pip install pylint + python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + shell: cmd + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build-windows-x86_64, test] diff --git a/tests/pylint.py b/tests/pylint.py new file mode 100644 index 00000000..d10ad684 --- /dev/null +++ b/tests/pylint.py @@ -0,0 +1,3 @@ +from cv2 import getStructuringElement, MORPH_ELLIPSE + +a = getStructuringElement(MORPH_ELLIPSE, (3, 3)) diff --git a/travis_config.sh b/travis_config.sh index dfb656e8..751a1772 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -141,37 +141,36 @@ function run_tests { PYTHON=python$PYTHON_VERSION - if [ -n "$IS_OSX" ]; then - echo "Running for OS X" - - cd ../tests - $PYTHON get_build_info.py - - cd ../opencv/ - export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata - else - echo "Running for linux" - - if [ $PYTHON == "python3.6" ]; then - $PYTHON -m pip install -U numpy==1.19.4 - fi - cd /io/tests - $PYTHON get_build_info.py + echo "Running for linux" - cd /io/opencv - export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata + if [ $PYTHON == "python3.6" ]; then + $PYTHON -m pip install -U numpy==1.19.4 fi + cd /io/tests + $PYTHON get_build_info.py + + cd /io/opencv + export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata test_wheels + pylint_test } function test_wheels { - echo "Starting tests..." + echo "Starting OpenCV tests..." #Test package $PYTHON modules/python/test/test.py -v --repo . } +function pylint_test { + + echo "Starting Pylint tests..." + + $PYTHON -m pip install pylint + $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring +} + export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' set -x