On Sunday 17 August 2014 17:36:12 Michael Manfre wrote:
> AssertNumQueries is often a problem for 3rd party backends.
> AssertMaxQueries would become the same and likely result in poorly written
> tests because of the inherent slop factor in the arbitrarily chosen max
> value.
> 

I agree with the concern, but I also note the intended use:

> On Sun, Aug 17, 2014 at 2:52 AM, Roger Hunwicks <[email protected]>
> > I want to write a test that tries every registered URL and makes sure
> > that none of them has an excessive number of queries.
> > 

This implies that the limit chosen should not be tight; also, it sounds like 
it is meant mostly for DML, where the differences in number of queries between 
backends are relatively small (unlike DDL). I think with documentation noting 
these points, AssertMaxQueries could be a welcome addition and maybe even 
useful for Django's own test-suite.

That said,

> > Would that be a useful contribution to Django proper, or should I just
> > create it in my own tests/utils.py.
> > 

I think you should first have it working for yourself, then, with some 
experience in its use, offer it to the community. Don't put too much into that 
"some experience" -- just make sure you write some tests with it and it really 
works as well as you expect.

HTH,
        Shai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/201408171753.49569.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to