How to use nose's assert_raises?
问题 I've searched for documentation, but couldn't find any. There were a couple that didn't explain much. Can someone explain to me Nose's assert_raises(what should I put here?) function and how to use it? 回答1: The assert_raises() function tests to make sure a function call raises a specified exception when presented with certain parameters. For example, if you had a function add that adds two numbers, it should probably raise a TypeError when you pass it, say, an integer and a string. So: from