#17365: Add optional unittest2 discovery test suite runner -------------------------------------+------------------------------------- Reporter: jezdez | Owner: nobody Type: New feature | Status: new Component: Testing framework | Version: SVN Severity: Normal | Resolution: Keywords: | Triage Stage: Design Has patch: 0 | decision needed Needs tests: 0 | Needs documentation: 0 Easy pickings: 0 | Patch needs improvement: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by carljm): Besides test discovery, the other thing this gives you is a more powerful way to specify which tests to run via commandline, by using real dotted path rather than the pseudo-dotted-path `applabel.TestCaseClass.testcasemethod`. Right now, if your tests within an app are split into submodules, there is no way to say "run just the tests in this module." You have to run either the entire app's tests, or a single `TestCase` subclass. With this runner, you can just give the real dotted path to the module. So we could make this the default for new `startproject`s without breaking back-compat. The biggest question is how to set `TEST_DISCOVERY_ROOT` by default. This is a bit of a puzzle, since we currently don't preset any settings with paths (e.g. users have to set `TEMPLATE_DIRS` and `STATICFILES_DIRS` themselves), and I'm not really interested in reintroducing any magic "find the project directory" code. I suppose one option would be to have `TEST_DISCOVERY_ROOT` default to empty, and if it's empty discover tests in all `INSTALLED_APPS` (but with robust discovery that includes all files matching the test* pattern, including sub-modules, not the "models.py and tests.py only" approach that we have now). Then if someone prefers keeping tests outside of apps, they could set `TEST_DISCOVERY_ROOT` to their preferred location. -- Ticket URL: <https://code.djangoproject.com/ticket/17365#comment:6> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.