kgashok / pymox

Automatically exported from code.google.com/p/pymox
Apache License 2.0
0 stars 0 forks source link

IgnoreArgs #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
sometimes i really don't want to care about any of the args.  afaict the only 
way to do this is multiple mox.IgnoreArg() arguments, that's silly.  allow 
mox.IgnoreArgs() to just ignore all args so we're not testing things we don't 
care to test (e.g. how many args are sent to our logging function!)

Original issue reported on code.google.com by ice...@gmail.com on 28 Jun 2010 at 8:03

GoogleCodeExporter commented 8 years ago

Original comment by steve.mi...@gmail.com on 28 Jun 2010 at 9:25

GoogleCodeExporter commented 8 years ago
use-case: logging.error et. al. It is recommended that the % not be used in 
logging calls, and instead to pass var args. If my test just verifies that 
logging calls are made, it can't (or at least shouldn't) know how many args 
logging.error (or whatever) receives.

In this case, IgnoreAllArgs is not just a convenience, it makes tests more 
robust, because if the logging calls are changed by adding more arguments, 
having a fixed number of IgnoreArg's will result in a broken test, even if the 
code under test is correct.

Anyway, not a huge deal, but definitely nice to have.

Original comment by danielw...@google.com on 11 Oct 2012 at 8:56