Antoine Pitrou <pit...@free.fr> added the comment:

Some style comments:

- don't use "except: self.fail()", just let the exception pass through

- when monkeypatching hmac.new, use a try...finally block so that the mock 
doesn't stay in place if the test fails for whatever reason

- it's a bit of a nit, but when using "with warnings.catch_warnings", I would 
put the asserts on the context manager result outside of the "with" block

- I get a warning in test_noncallable_digestmod, it would be nice to silence it:

/home/antoine/cpython/default/Lib/test/test_hmac.py:254: RuntimeWarning: No 
block_size attribute on given digest object; Assuming 64.
  h = hmac.HMAC(b"key", b"", hmac)

----------
nosy: +gregory.p.smith, pitrou
stage:  -> patch review

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14322>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to