2014-05-07 19:18 GMT+02:00 Shai Berger <s...@platonix.com>:

> > *1) Checking database features*
> >
> > This is the correct solution for database-dependant tests in general.
>
> In most cases, it is. But in some cases, you need to differentiate on
> severely
> idiosyncratic behaviors, which defy attempts to define them as anything but
> "behaves like MySql".
>

Yes, that's the (only) appropriate use case for connection.vendor checks.

> *Would you object to adding "microsoft" to explicit checks for
> > connection.vendor where appropriate?*
> >
>
> That seems ugly to me, unless we actually add a core backend for SQL
> Server.
> It feels like adding a dependency on 3rd-party projects.
>

It isn't exactly a dependency, but I see what you mean.


> I suggest, instead, that we solve the problem for real (so even Firebird
> can
> enjoy it): Remove all vendor checks except for positive checking. Replace
> conditional code with either conditions on feature flags, or refactoring
> into
> separate test functions; and replace negative checks by an API allowing the
> backends to filter the tests. So, instead of a test saying "I'm not
> running on
> Oracle", let Oracle say "I'm not running these tests".
>

Yes, that's the best solution. I'll audit connection.vendor checks and see
how
many flags we need to introduce.

-- 
Aymeric.

PS: while we're there, we could also audit feature flags and deprecate
obsolete ones, like those for versions of SQLite from 10 years ago.

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/CANE-7mXGOx3QNUcAgmEKEUyD_cVdfRA89qoWMRODARbtEZ4J0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to