Skip to content

python: discover tests from module/misc/python/test paths - #14078

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
alalek:test_python_from_modules
Apr 12, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
alalek:test_python_from_modules

Conversation

@alalek

@alalek alalek commented Mar 16, 2019 •

Copy link
Copy Markdown
Member

support python tests from opencv_contrib

Names must be unique (test_<name>.py).

TODOs:

  • Check ARMv7 builder, add installation rules
docker_image:Custom=ubuntu-clang:18.04

Comment thread cmake/OpenCVUtils.cmake Resolved
Comment thread cmake/OpenCVUtils.cmake Resolved
def load_tests(loader, tests, pattern):
tests.addTests(loader.discover(basedir, pattern=os.environ.get('OPENCV_PYTEST_FILTER', 'test_') + '*.py'))
cwd = os.getcwd()
config_file = 'opencv_python_tests.cfg'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some cases it can be convenient to run tests from directory other than <build>.

We could add new parameter to test app...

./opencv/modules/python/test/test.py --repo opencv --test_root opencv --test_root opencv_contrib

And discover tests using recursive directory walk based on provided paths.

If we had ability to detect enabled modules list in runtime built into binaries (python at least), we could skip or filter disabled tests dynamically, without extra config files.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main purpose of this patch is enabling testing of opencv_contrib modules.

@opencv-pushbot
opencv-pushbot merged commit a0a1fb5 into opencv:3.4 Apr 12, 2019
This was referenced Apr 12, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants