[Libguestfs] [PATCH] python: tests: use more targeted assert*() functions/checks

Richard W.M. Jones rjones at redhat.com
Fri Feb 12 17:13:17 UTC 2016


On Fri, Feb 12, 2016 at 06:04:47PM +0100, Pino Toscano wrote:
> - use assertIsInstance, assertNotEqual, and assertIsNotNone as more
>   specific checks (will produce better logging)
> - use assertRaises when expecting exceptions being thrown
> - when testing internal_test_rhashtable, instead of checking type and
>   elements of the return values just check the return value as a whole
>   (easier and already getting all the work needed by unittest)

Good find!  I was going by the documentation which didn't mention any
of these asserts.

ACK, assuming it also works with python3, ie this passes:

  PYTHON=/usr/bin/python3 ./configure && make && make -C test-data check && make -C python check

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list