Skip to content

Ambitious meta programming in opencv-python produces warnings from coverage analysis static analysis tool. #27867

@ruck94301

Description

@ruck94301

System Information

A cv2 import statement has pytest-cov looking for two source files in cwd instead of in site-packages/cv2.
So two warnings are issued, because coverage doesn't find config.py and config-3.py.

This with MacOS and opencv-4.12.

pytest reports: darwin -- Python 3.10.11, pytest-8.4.2, pluggy-1.6.0
pip-list reports opencv-python 4.12.0.88

Detailed description

A clear and concise description, including simple steps to reproduce is here:
https://github.com/pytest-dev/pytest-cov/issues/721
cv2 import has pytest-cov looking for two source files in cwd instead of in site-packages/cv2

As you can see, I originally describe it as a pytest-cov issue,
but a pytest-cov developer says it's an opencv-python issue, and closed it, and directed me to report as bug against opencv-python.

Steps to reproduce

Minimal example in a fresh venv with pytest and pytest-cov is described here:
https://github.com/pytest-dev/pytest-cov/issues/721
cv2 import has pytest-cov looking for two source files in cwd instead of in site-packages/cv2

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions