Here's the one that made my think it's done everywhere, but even this test case has both styles:<div><br></div><div><a href="https://github.com/openstack/nova/blob/master/nova/tests/api/openstack/compute/contrib/test_hosts.py#L116">https://github.com/openstack/nova/blob/master/nova/tests/api/openstack/compute/contrib/test_hosts.py#L116</a><br>

</div><div><br></div><div>So the 'use the DB' style is better eh ?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 10, 2012 at 2:02 PM, Monty Taylor <span dir="ltr"><<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
We do this already. Every test in Nova creates a new in-memory sqlite<br>
database.<br>
<br>
In addition - on a machine with a proper config (which we detect) we<br>
have a couple of tests which check some things against a MySQL database<br>
(mainly to ensure that we properly create tables as InnoDB)<br>
<br>
Can you point towards something that does not do this?<br>
<br>
Monty<br>
<div class="im"><br>
On 12/09/2012 03:59 PM, Matthew Sherborne wrote:<br>
> Why don't we create and destroy a test sqlite in memory database for the<br>
> tests instead of stubbing out the DB calls ?<br>
><br>
</div>> *Pros:*<br>
<div class="im">> More thorough testing<br>
> More straight forward testing (create records instead of whole mock<br>
> structures)<br>
> Easier to create new tests, no need to stub everything out again, just<br>
> use the base test DB<br>
><br>
</div>> *Cons:*<br>
<div class="im">> Probably slower tests<br>
><br>
> Has anyone looked at this in the past ?<br>
><br>
> All comments appreciated.<br>
><br>
> Kind Regards,<br>
> Matthew Sherborne<br>
><br>
><br>
</div>> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div>