mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Moving tp_class access, and consistent fully-qualified naming for PyPy, to detail::get_tp_name (#2520)
* Moving tp_class access, and consistent fully-qualified naming for PyPy, to detail::get_tp_name * Change get_tp_name to get_fully_qualified_tp_name
This commit is contained in:
@@ -152,10 +152,8 @@ def test_inheritance_init(msg):
|
||||
pass
|
||||
with pytest.raises(TypeError) as exc_info:
|
||||
Python()
|
||||
expected = ["m.class_.Pet.__init__() must be called when overriding __init__",
|
||||
"Pet.__init__() must be called when overriding __init__"] # PyPy?
|
||||
# TODO: fix PyPy error message wrt. tp_name/__qualname__?
|
||||
assert msg(exc_info.value) in expected
|
||||
expected = "m.class_.Pet.__init__() must be called when overriding __init__"
|
||||
assert msg(exc_info.value) == expected
|
||||
|
||||
# Multiple bases
|
||||
class RabbitHamster(m.Rabbit, m.Hamster):
|
||||
@@ -164,9 +162,8 @@ def test_inheritance_init(msg):
|
||||
|
||||
with pytest.raises(TypeError) as exc_info:
|
||||
RabbitHamster()
|
||||
expected = ["m.class_.Hamster.__init__() must be called when overriding __init__",
|
||||
"Hamster.__init__() must be called when overriding __init__"] # PyPy
|
||||
assert msg(exc_info.value) in expected
|
||||
expected = "m.class_.Hamster.__init__() must be called when overriding __init__"
|
||||
assert msg(exc_info.value) == expected
|
||||
|
||||
|
||||
def test_automatic_upcasting():
|
||||
|
||||
Reference in New Issue
Block a user