> On 10 Feb 2015, at 00:12, Tim Graham <[email protected]> wrote: > > Is it a best practice? In my unscientific sampling, none of the following > ship tests inside the application directory, but rather in a separate "tests" > directory. Or did I misunderstand what you meant? > > - Django REST framework > - django-nap > - the apps that split out from contrib (formtools, comments, localflavor)
I think there's been a tendency in the past years ever since we saw an increasing adoption of the unittest2 discover runner anecdotally (and maybe also the Nose and pytest runners) to localize reusable app tests outside their main package to not accidentally trigger them when installed in a Django project that uses the old style test runner. That's also been the reason why I moved the tests outside of formtools, localflavor and almost all my apps – providing tests in app repos makes sense, but to me the reason to put them into the main package is mostly historical, so nothing I would want to continue to promote for the freshly extracted localflavor and formtools apps. IIRC Carl had a more elaborate explanation at the time we were adding the discover runner to Django, but that's my gist of it. +0 for moving app tests outside the contrib apps folders but +1 on updating the app docs to promote tests outside the main packages. Jannis > On Monday, February 9, 2015 at 5:28:22 PM UTC-5, Curtis Maloney wrote: > Just to shine a light on another perspective- I frequently tell people to > look at contrib for "best practices", and including tests within a 3rd party > app would fall under that. > > -- > Curtis > > On 10 Feb 2015 03:34, "Marc Tamlyn" <[email protected]> wrote: > +1 to removing tests from contrib itself, so long as they remain obviously > separated in the test section in case of future removals from core. > > On 9 February 2015 at 15:44, Preston Timmons <[email protected]> wrote: > I think the "need" is mainly conceptual--whether tests are more appropriately > grouped with their app or with the other tests. With the discover runner it's > uncommon that contrib tests are included in any local test runs. > > I do prefer moving all tests into the tests directory. The logic to get > test_modules in runtests.py would be simplified quite a bit from it. > > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" 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/ba79f1b9-678e-4fdf-8f7a-26319e5ac4d3%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" 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/CAMwjO1EJWzd0G0noSAHFL3ZsOP9kc6He6%2Bb1a5%3DAe3KhxBBfVg%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" 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/4588baf5-2c6f-463c-a994-0ed4fe9a83ba%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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/34C92B98-4F90-4A43-BCE4-1E42DC6ABD02%40gmail.com. For more options, visit https://groups.google.com/d/optout.
