diff --git a/tests/test_dispatcher.py b/tests/test_dispatcher.py index d831034c..27416a4a 100644 --- a/tests/test_dispatcher.py +++ b/tests/test_dispatcher.py @@ -16,9 +16,10 @@ def g(x: float): pass assert set(dispatch.functions.keys()) == {"f", "g"} - assert dispatch.functions["f"].methods[0] == Signature(int) - assert dispatch.functions["g"].methods[0] == Signature(float) - assert dispatch.functions["g"].methods[0].precedence == 1 + assert dispatch.functions["f"].methods[0].signature == Signature(int) + assert dispatch.functions["g"].methods[0].signature == Signature( + float, precedence=1 + ) def test_dispatch_class(): @@ -37,9 +38,10 @@ def g(x: float): a = "tests.test_dispatcher.test_dispatch_class..A" b = "tests.test_dispatcher.test_dispatch_class..B" assert set(dispatch.classes.keys()) == {a, b} - assert dispatch.classes[a]["f"].methods[0] == Signature(int) - assert dispatch.classes[b]["g"].methods[0] == Signature(float) - assert dispatch.classes[b]["g"].methods[0].precedence == 1 + assert dispatch.classes[a]["f"].methods[0].signature == Signature(int) + assert dispatch.classes[b]["g"].methods[0].signature == Signature( + float, precedence=1 + ) def test_dispatch_multi(): @@ -56,7 +58,7 @@ def f(x): assert f(1) == "int" assert f(1.0) == "float or str" assert f("1") == "float or str" - assert dispatch.functions["f"].methods[2].precedence == 1 + assert dispatch.functions["f"].methods[2].signature.precedence == 1 # Check that arguments to `dispatch.multi` must be tuples or signatures. with pytest.raises(ValueError):