Skip to content

Commit 333ad56

Browse files
authored
fix: update TypeError message assertions for pyo3 0.29 str type errors
pyo3 0.29 changed the TypeError message when passing an int where str is expected: - Old: "object cannot be interpreted as str" - New: "'int' object is not an instance of 'str'" Update the two failing test assertions to match the new message format.
1 parent a5d8417 commit 333ad56

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/test_hexhamming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_hamming_distance_byte(hex1, hex2, expected):
9090
@pytest.mark.parametrize(
9191
"hex1,hex2,exception,msg",
9292
(
93-
("abc", 3, TypeError, "object cannot be"),
93+
("abc", 3, TypeError, "not an instance of 'str'"),
9494
("abc", "a", ValueError, "strings are NOT the same length"),
9595
("lol", "foo", ValueError, "hex string contains invalid char"),
9696
("000abcdef", "011abcdgf", ValueError, "hex string contains invalid char"),
@@ -171,7 +171,7 @@ def test_check_bytes_within_dist(bytes1, bytes2, max_dist, expected):
171171
("000abcdef", "011abcdef", -1, ValueError, "`max_dist` must be >0"),
172172
("000abcdef", "011abcdzz", 3, ValueError, "hex string contains invalid char"),
173173
("000abcdef", "011abcdgf", 3, ValueError, "hex string contains invalid char"),
174-
("1f0abcdef", 3, 3, TypeError, "object cannot be"),
174+
("1f0abcdef", 3, 3, TypeError, "not an instance of 'str'"),
175175
("011abcdef", "00", 3, ValueError, "strings are NOT the same length"),
176176
),
177177
)

0 commit comments

Comments
 (0)