Skip to content

Commit 0d43fa4

Browse files
committed
Add explicit parametrize ids to work around pytest bug
pytest-dev/pytest#2644
1 parent 77e6df5 commit 0d43fa4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/core/eth-module/test_accounts.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def test_eth_account_recover_message(web3):
153153
b'\x0cu0\x84\xe5\xa8)\x02\x192L\x1a:\x86\xd4\x06M\xed-\x15\x97\x9b\x1e\xa7\x90sJ\xaa,\xea\xaf\xc1"\x9c\xa4S\x81\x06\x81\x9f\xd3\xa5P\x9d\xd3\x83\xe8\xfeKs\x1chp3\x95V\xa5\xc0o\xeb\x9c\xf30\xbb\x00', # noqa: E501
154154
# test signature bytes with chain-naive v (27 in this case)
155155
b'\x0cu0\x84\xe5\xa8)\x02\x192L\x1a:\x86\xd4\x06M\xed-\x15\x97\x9b\x1e\xa7\x90sJ\xaa,\xea\xaf\xc1"\x9c\xa4S\x81\x06\x81\x9f\xd3\xa5P\x9d\xd3\x83\xe8\xfeKs\x1chp3\x95V\xa5\xc0o\xeb\x9c\xf30\xbb\x1b', # noqa: E501
156-
]
156+
],
157+
ids=['test_sig_bytes_standard_v', 'test_sig_bytes_chain_naive_v']
157158
)
158159
def test_eth_account_recover_signature_bytes(web3, signature_bytes):
159160
msg_hash = b'\xbb\r\x8a\xba\x9f\xf7\xa1<N,s{i\x81\x86r\x83{\xba\x9f\xe2\x1d\xaa\xdd\xb3\xd6\x01\xda\x00\xb7)\xa1' # noqa: E501
@@ -206,7 +207,8 @@ def test_eth_account_recover_vrs_standard_v(web3):
206207
'Hello World',
207208
HexBytes('0xa1de988600a42c4b4ab089b619297c17d53cffae5d5120d82d8a92d0bb3b78f2'),
208209
),
209-
]
210+
],
211+
ids=['message_to_sign', 'hexstr_as_text', 'hello_world']
210212
)
211213
def test_eth_account_hash_message_text(web3, message, expected):
212214
assert web3.eth.account.hashMessage(text=message) == expected
@@ -223,7 +225,8 @@ def test_eth_account_hash_message_text(web3, message, expected):
223225
'0x29d9f7d6a1d1e62152f314f04e6bd4300ad56fd72102b6b83702869a089f470c',
224226
HexBytes('0xe709159ef0e6323c705786fc50e47a8143812e9f82f429e585034777c7bf530b'),
225227
),
226-
]
228+
],
229+
ids=['hexbytes_1', 'hexbytes_2']
227230
)
228231
def test_eth_account_hash_message_hexstr(web3, message, expected):
229232
assert web3.eth.account.hashMessage(hexstr=message) == expected
@@ -243,6 +246,7 @@ def test_eth_account_hash_message_hexstr(web3, message, expected):
243246
HexBytes('0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c'), # noqa: E501
244247
),
245248
),
249+
ids=['account_1']
246250
)
247251
def test_eth_account_sign(web3, message, key, expected_bytes, expected_hash, v, r, s, signature):
248252
signed = web3.eth.account.sign(message_text=message, private_key=key)
@@ -277,6 +281,7 @@ def test_eth_account_sign(web3, message, key, expected_bytes, expected_hash, v,
277281
37,
278282
),
279283
),
284+
ids=['account_1']
280285
)
281286
def test_eth_account_sign_transaction(web3, txn, private_key, expected_raw_tx, tx_hash, r, s, v):
282287
signed = web3.eth.account.signTransaction(txn, private_key)

0 commit comments

Comments
 (0)