update pybind11

This commit is contained in:
Thomas Kunze
2024-06-29 16:50:08 +02:00
249 changed files with 31681 additions and 11123 deletions

View File

@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import pytest
from pybind11_tests import operators as m
from pybind11_tests import ConstructorStats
from pybind11_tests import operators as m
def test_operator_overloading():
@@ -130,12 +132,12 @@ def test_nested():
def test_overriding_eq_reset_hash():
assert m.Comparable(15) is not m.Comparable(15)
assert m.Comparable(15) == m.Comparable(15)
with pytest.raises(TypeError):
hash(m.Comparable(15)) # TypeError: unhashable type: 'm.Comparable'
with pytest.raises(TypeError) as excinfo:
hash(m.Comparable(15))
assert str(excinfo.value).startswith("unhashable type:")
for hashable in (m.Hashable, m.Hashable2):
assert hashable(15) is not hashable(15)
@@ -143,3 +145,9 @@ def test_overriding_eq_reset_hash():
assert hash(hashable(15)) == 15
assert hash(hashable(15)) == hash(hashable(15))
def test_return_set_of_unhashable():
with pytest.raises(TypeError) as excinfo:
m.get_unhashable_HashMe_set()
assert str(excinfo.value.__cause__).startswith("unhashable type:")