Opened 14 years ago

Last modified 13 years ago

#12191 closed

It's not possible to run a specific test if it's not in models.py or tests.py (e.g. when using suites) — at Initial Version

Reported by: dolapo Owned by: nobody
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

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.

Change History (1)

by dolapo, 14 years ago

Attachment: tests_specify_module.diff added
Note: See TracTickets for help on using tickets.
Back to Top