mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913)
* Update cast.h * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Move definition to detail/common, change name, apply everywhere * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename debug_enabled in tests to detailed_error_messages_enabled
This commit is contained in:
committed by
GitHub
parent
75007dda72
commit
f0b9f755e4
@@ -4,7 +4,7 @@ import sys
|
||||
import pytest
|
||||
|
||||
import env
|
||||
from pybind11_tests import debug_enabled
|
||||
from pybind11_tests import detailed_error_messages_enabled
|
||||
from pybind11_tests import pytypes as m
|
||||
|
||||
|
||||
@@ -416,8 +416,8 @@ def test_print(capture):
|
||||
m.print_failure()
|
||||
assert str(excinfo.value) == "Unable to convert call argument " + (
|
||||
"'1' of type 'UnregisteredType' to Python object"
|
||||
if debug_enabled
|
||||
else "to Python object (compile in debug mode for details)"
|
||||
if detailed_error_messages_enabled
|
||||
else "to Python object (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user