Skip to content

Commit 9de011e

Browse files
committed
Added pylint test
1 parent 8880543 commit 9de011e

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

.github/workflows/build_wheels_macos.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ jobs:
171171
cd ${{ github.workspace }}/opencv
172172
python modules/python/test/test.py -v --repo .
173173
174+
- name: Pylint test
175+
run: |
176+
python -m pip install pylint
177+
python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
178+
174179
test_release_opencv_python:
175180
if: github.event_name == 'release' && github.event.release.prerelease
176181
needs: [build, test]

.github/workflows/build_wheels_macos_m1.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ jobs:
106106
cd ${{ github.workspace }}/opencv
107107
arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
108108
109+
- name: Pylint test
110+
run: |
111+
arch -arm64 python${{ matrix.python-version }} -m pip install pylint
112+
arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
113+
109114
test_release_opencv_python:
110115
if: github.event_name == 'release' && github.event.release.prerelease
111116
needs: [build, test]

.github/workflows/build_wheels_windows.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ jobs:
130130
python modules\python\test\test.py -v --repo .
131131
shell: cmd
132132

133+
- name: Pylint test
134+
run: |
135+
python -m pip install pylint
136+
python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
137+
shell: cmd
138+
133139
test_release_opencv_python:
134140
if: github.event_name == 'release' && github.event.release.prerelease
135141
needs: [build-windows-x86_64, test]

tests/pylint.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from cv2 import getStructuringElement, MORPH_ELLIPSE
2+
3+
a = getStructuringElement(MORPH_ELLIPSE, (3, 3))

travis_config.sh

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -141,37 +141,36 @@ function run_tests {
141141

142142
PYTHON=python$PYTHON_VERSION
143143

144-
if [ -n "$IS_OSX" ]; then
145-
echo "Running for OS X"
146-
147-
cd ../tests
148-
$PYTHON get_build_info.py
149-
150-
cd ../opencv/
151-
export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata
152-
else
153-
echo "Running for linux"
154-
155-
if [ $PYTHON == "python3.6" ]; then
156-
$PYTHON -m pip install -U numpy==1.19.4
157-
fi
158-
cd /io/tests
159-
$PYTHON get_build_info.py
144+
echo "Running for linux"
160145

161-
cd /io/opencv
162-
export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata
146+
if [ $PYTHON == "python3.6" ]; then
147+
$PYTHON -m pip install -U numpy==1.19.4
163148
fi
149+
cd /io/tests
150+
$PYTHON get_build_info.py
151+
152+
cd /io/opencv
153+
export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata
164154

165155
test_wheels
156+
pylint_test
166157
}
167158

168159
function test_wheels {
169160

170-
echo "Starting tests..."
161+
echo "Starting OpenCV tests..."
171162

172163
#Test package
173164
$PYTHON modules/python/test/test.py -v --repo .
174165
}
175166

167+
function pylint_test {
168+
169+
echo "Starting Pylint tests..."
170+
171+
$PYTHON -m pip install pylint
172+
$PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
173+
}
174+
176175
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
177176
set -x

0 commit comments

Comments
 (0)