#12191: It's not possible to run a specific test if it's not in models.py or tests.py (e.g. when using suites) -------------------------------------+------------------------------------- Reporter: dolapo | Owner: dolapo Type: | Status: closed Cleanup/optimization | Component: Testing framework Milestone: | Severity: Normal Version: 1.1 | Keywords: testing test Resolution: duplicate | Has patch: 1 Triage Stage: Accepted | Needs tests: 0 Needs documentation: 0 | Easy pickings: 0 Patch needs improvement: 1 | UI/UX: 0 | -------------------------------------+------------------------------------- Changes (by ramiro):
* status: assigned => closed * ui_ux: => 0 * resolution: => duplicate * easy: => 0 Old description: > The simple django looks for tests in either models.py or tests.py. This > is unfortunate for large applications since tests.py in each app becomes > rather large and unwieldy. Apps with a large number of tests can break > out their tests further by creating a method called suite() that returns > a TestSuite. This works for test separation but because the runner still > looks for test cases in models.py or tests.py it is no longer possible to > run an individual TestCase or TestCase.test_method. > Proposal: > In addition to supporting the ability to specify tests to run as: > o app > o app.TestCase > o app.TestCase.test_method > > also support: > o app.module.TestCase.test_method > o app.module.TestCase.* > > I'm including a patch which adds this functionality. New description: The simple django test runner looks for tests in either models.py or tests.py. This is unfortunate for large applications since tests.py in each app becomes rather large and unwieldy. Apps with a large number of tests can break out their tests further by creating a method called `suite()` that returns a `TestSuite`. This works for test separation but because the runner still looks for test cases in models.py or tests.py it is no longer possible to run an individual `TestCase` or `TestCase.test_method` . Proposal: In addition to supporting the ability to specify tests to run as: * `app` * `app.TestCase` * `app.TestCase.test_method` also support: * `app.module.TestCase.test_method` * `app.module.TestCase.*` I'm including a patch which adds this functionality. -- Comment: Duplicate of #6712. -- Ticket URL: <https://code.djangoproject.com/ticket/12191#comment:5> 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.