Opened 9 years ago

Closed 7 years ago

#12191 closed Cleanup/optimization (duplicate)

It's not possible to run a specific test if it's not in or (e.g. when using suites)

Reported by: dolapo Owned by: dolapo
Component: Testing framework Version: 1.1
Severity: Normal Keywords: testing test
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Ramiro Morales)

The simple django test runner looks for tests in either or This is unfortunate for large applications since 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 or it is no longer possible to run an individual TestCase or TestCase.test_method .

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.

Attachments (2)

tests_specify_module.diff (4.5 KB) - added by dolapo 9 years ago.
testpackage.diff (1.8 KB) - added by mapleoin 8 years ago.
documentation patch

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by dolapo

Attachment: tests_specify_module.diff added

comment:1 Changed 9 years ago by dolapo

Owner: changed from nobody to dolapo
Status: newassigned

Since I screwed up the formatting in the description, this patch adds to the simple test runner the ability to run tests as:


comment:2 Changed 8 years ago by mapleoin

This looks more like a documentation bug to me, you can replace with a tests python package and you can have as many submodules as you want in different files in that package as explained in the Python docs.

I'm attaching a documentation patch.

Changed 8 years ago by mapleoin

Attachment: testpackage.diff added

documentation patch

comment:3 Changed 8 years ago by Eric Holscher

Triage Stage: UnreviewedAccepted

comment:4 Changed 7 years ago by Matt McClanahan

Severity: Normal
Type: Cleanup/optimization

comment:5 Changed 7 years ago by Ramiro Morales

Description: modified (diff)
Easy pickings: unset
Resolution: duplicate
Status: assignedclosed
UI/UX: unset

Duplicate of #6712.

Note: See TracTickets for help on using tickets.
Back to Top