mirror of
https://github.com/thelsing/knx.git
synced 2026-03-07 02:17:30 +01:00
update pybind11
This commit is contained in:
@@ -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:")
|
||||
|
||||
Reference in New Issue
Block a user