From c372312bd610175b68795eef7b4a0dedf711316d Mon Sep 17 00:00:00 2001 From: Wessel Bruinsma Date: Mon, 25 Mar 2024 20:31:45 +0100 Subject: [PATCH] Test that `conversion_method` returns the function --- tests/test_promotion.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_promotion.py b/tests/test_promotion.py index 460bcbb9..ed73c0f7 100644 --- a/tests/test_promotion.py +++ b/tests/test_promotion.py @@ -50,6 +50,9 @@ def num_to_fp(x): assert convert(r, Num) == r assert convert(r, Rat) == 3.0 + # Test that `conversion_method` returns the function. + assert num_to_fp(1) == 3.0 + def test_convert_resolve_type_hints(convert): add_conversion_method(int, float, lambda x: 2.0)