mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
Merge pull request #23969 from asmorkalov:as/python2_test_fix
Fixed tests execution with Python 2.7
This commit is contained in:
commit
53af876999
@ -71,7 +71,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
operator bool() {
|
operator bool() {
|
||||||
return static_cast<bool>(obj_);
|
return obj_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject* release()
|
PyObject* release()
|
||||||
|
@ -223,6 +223,11 @@ class Arguments(NewOpenCVTests):
|
|||||||
for dtype in (object, str, np.complex128):
|
for dtype in (object, str, np.complex128):
|
||||||
test_array = np.zeros((4, 4, 3), dtype=dtype)
|
test_array = np.zeros((4, 4, 3), dtype=dtype)
|
||||||
msg = ".*type = {} is not supported".format(test_array.dtype)
|
msg = ".*type = {} is not supported".format(test_array.dtype)
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
self.assertRaisesRegexp(
|
||||||
|
Exception, msg, cv.utils.dumpInputArray, test_array
|
||||||
|
)
|
||||||
|
else:
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
Exception, msg, cv.utils.dumpInputArray, test_array
|
Exception, msg, cv.utils.dumpInputArray, test_array
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user