@@ -598,7 +598,13 @@ def test_signature_validity(gen, msg, qx, qy, r, s, expected):
598598 elliptic curve of `gen`, `r` and `s` are the signature, and
599599 `expected` is True iff the signature is expected to be valid."""
600600 pubk = Public_key (gen , ellipticcurve .Point (gen .curve (), qx , qy ))
601- assert expected == pubk .verifies (digest_integer (msg ), Signature (r , s ))
601+ with pytest .warns (DeprecationWarning ) as warns :
602+ msg_dgst = digest_integer (msg )
603+ assert len (warns ) == 3
604+ assert "unused" in warns [0 ].message .args [0 ]
605+ assert "unused" in warns [1 ].message .args [0 ]
606+ assert "unused" in warns [2 ].message .args [0 ]
607+ assert expected == pubk .verifies (msg_dgst , Signature (r , s ))
602608
603609
604610@pytest .mark .parametrize (
@@ -607,7 +613,13 @@ def test_signature_validity(gen, msg, qx, qy, r, s, expected):
607613def test_pk_recovery (gen , msg , r , s , qx , qy , expected ):
608614 del expected
609615 sign = Signature (r , s )
610- pks = sign .recover_public_keys (digest_integer (msg ), gen )
616+ with pytest .warns (DeprecationWarning ) as warns :
617+ msg_dgst = digest_integer (msg )
618+ assert len (warns ) == 3
619+ assert "unused" in warns [0 ].message .args [0 ]
620+ assert "unused" in warns [1 ].message .args [0 ]
621+ assert "unused" in warns [2 ].message .args [0 ]
622+ pks = sign .recover_public_keys (msg_dgst , gen )
611623
612624 assert pks
613625
@@ -675,4 +687,8 @@ def test_sig_verify(args):
675687
676688
677689def test_int_to_string_with_zero ():
678- assert int_to_string (0 ) == b"\x00 "
690+ with pytest .warns (DeprecationWarning ) as warns :
691+ assert int_to_string (0 ) == b"\x00 "
692+
693+ assert len (warns ) == 1
694+ assert "unused" in warns [0 ].message .args [0 ]
0 commit comments