среда, 20 марта 2013 г., 21:22:10 UTC+6 пользователь Aymeric Augustin написал: > > On 20 mars 2013, at 11:22, Russell Keith-Magee > <rus...@keith-magee.com<javascript:>> > wrote: > > > Personally, I'd rather see the opposite -- contrib apps containing their > own tests, and the tests directory containing just the tests for Django > itself. That enforces the fact that the apps really are self contained > apps, and can be tested independently. > > > The catch -- and the reason why the tests are broken up the way they are > -- is that the test framework isn't currently rich enough to support this. > Admin is the best example of this -- in order to test admin, you need > different test models in different test apps, and the current test > framework doesn't support this very well. > > Ah, I didn't know that was the reason. I assumed it was just because of > history... > > > This really points at a deficiency in Django's testing tools that really > should be addressed. It's something I've wanted to look at for a while, but > I've never got around to it. It's also something that's likely to be easier > when the app refactor lands, because a lot of the problem lies in the app > cache. > > > The point about not running the tests under ./manage.py test is a > slightly moot point if we move to the unittest2 discovery mechanism -- last > time I looked at that patch, unittest2 discovery would mean that contrib > tests wouldn't be run (by default) in a project anyway. > > If these features were implemented, yes, they would bring the benefits I > listed. > > > There are a few other advantages in my proposal: > > - Most users don't need the tests. Moving them apart will make Django > tarballs smaller. For example, auth has as more tests than code (120kb vs > 100kb), and admin has nearly twice as much tests than code (420kb vs > 220kb). >
Currently all tests are a part of tarball, so moving tests out of contrib won't make tarballs smaller. > > - Shipping tests for half of the contrib apps is worse than not shipping > any tests at all. Users who notice will think either we have poor coverage > or our packages aren't built correctly. Users who don't notice may falsely > believe that Django's tests pass for all the contrib apps they use with > their settings, which may not be true. > > - The convenience of having all the tests in one directory at the toplevel > must be balanced with the philosophical correctness of dispatching them in > seventeen directories, four-levels-deep, which may themselves contain > entire app structures -- "flat is better than nested". > > - It would help in the short term :) > > -- > Aymeric. > > > > -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.