Skip to content

Commit

Permalink
Added pylint test
Browse files Browse the repository at this point in the history
  • Loading branch information
asenyaev committed Mar 22, 2022
1 parent 8880543 commit 9de011e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_wheels_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build_wheels_macos_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build_wheels_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 3 additions & 0 deletions tests/pylint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from cv2 import getStructuringElement, MORPH_ELLIPSE

a = getStructuringElement(MORPH_ELLIPSE, (3, 3))
37 changes: 18 additions & 19 deletions travis_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9de011e

Please sign in to comment.