[Openstack] Test Dependencies

Jay Pipes jaypipes at gmail.com
Fri Mar 2 18:17:08 UTC 2012


On 03/01/2012 08:12 PM, Maru Newby wrote:
> Is there any interest in adding unittest2 to the test dependencies for openstack projects?  I have found its enhanced assertions and 'with self.assertRaises' very useful in writing tests.  I see there have been past bugs that mentioned unittest2, and am wondering if the reasons for not adopting it still stand.

++ to unittest2. Frankly, it's a dependency of sqlalchemy, so it gets 
installed anyway during any installation. Might as well use it IMHO.

> Separately, is the use of mox open to discussion?  mock was recently added as a dependency to quantum to perform library patching, which isn't supported by mox as far as I know.

This is incorrect. pymox' stubout module can be used to perform library 
patching. You can see examples of this in Glance and Nova. For example:

https://github.com/openstack/glance/blob/master/glance/tests/unit/test_swift_store.py#L55

 > The ability to do non-replay mocking is another useful feature of 
mock.  I'm not suggesting that mox be replaced, but am wondering if mock 
could be an additional dependency and used when the functionality 
provided by mox falls short.

Might be easier to answer with some example code... would you mind 
pastebin'ing an example that shows what mock can do that mox can't?

Thanks much!
-jay

> Thanks,
>
>
> Maru
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp




More information about the Openstack mailing list