Ned Batchelder on Nostr: Another kind of bug revealed by including tests in your coverage: with ...
Published at
2025-05-01 19:18:08 UTCEvent JSON
{
"id": "1e5ebd1f43ae72eaf7714c34a8a27562788ed623c3e50c502946921130f505c5",
"pubkey": "3c1a5dbc82cfc12f65f6bd9e283d71bd4a6f1ca853640666cfd5c856037806b1",
"created_at": 1746127088,
"kind": 1,
"tags": [
[
"proxy",
"https://hachyderm.io/users/nedbat/statuses/114434184895430077",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.mostr.pub"
]
],
"content": "Another kind of bug revealed by including tests in your coverage:\n\nwith pytest.raises(ValueError):\n process_data(\"bad data 1\")\n process_data(\"bad data 2\") # never executed!\n\nhttps://nedbatchelder.com/blog/202008/you_should_include_your_tests_in_coverage.html",
"sig": "914c8b9839fc0a89733d6528e6c6ae2a8513de0a3f92e0dee1f244c68fc1fee874dd8834604ba57ce8379d15c9aa097653dd57f28d540decf0b1b867f841ff9e"
}