Opened 15 years ago
Closed 13 years ago
#11627 closed New feature (duplicate)
Allow users to run individual test suites using manage.py
Reported by: | Owned by: | Filip Gruszczyński | |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | egmanoj@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Django recognizes unit tests grouped into test suites (unittest.TestSuite
instances). However users cannot run individual test suites using manage.py. Allow users to run individual test suites.
Something like this:
python ./manage.py test my_app.feature_foo_test_suite
Attachments (2)
Change History (11)
comment:1 by , 15 years ago
follow-up: 3 comment:2 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 15 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Replying to mmalone:
It's already possible to run individual test cases or test methods via the manage.py command. See http://docs.djangoproject.com/en/dev/topics/testing/#id1
Yes, users can run individual test cases (unittest.TestCase instances) or test methods. However I was referring to test suites (unittest.TestSuite instances). Django allows users to group their test cases into test suites - the documentation mentions how this can be done and refers users to the Python docs for more details on how to organize test cases. These test suites however cannot be executed separately. Users can only execute individual test cases even though these test cases are grouped into test suites. If say, 10 test cases have been grouped into a suite for a feature and the feature changes, the user has to run the ten test cases separately rather than run a single test suite.
I think the ticket was possibly closed without considering the distinction between test cases and test suites.
comment:4 by , 15 years ago
Fair enough. I mistakenly assumed that since TestSuite implemented the same interface as TestCase Django would allow you to specify a TestSuite as you would a TestCase. But it looks like you're right -- Django calls unittest.TestLoader.loadTestsFromTestCase()
from
django.test.simple.build_test()
which raises an exception if you pass in an instance of TestSuite.
comment:5 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:6 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:7 by , 15 years ago
Patch needs improvement: | set |
---|
I have discussed the case with Russel and I will try to provide a better patch in a few days.
comment:8 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:9 by , 13 years ago
Easy pickings: | unset |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Duplicate of #6712.
It's already possible to run individual test cases or test methods via the manage.py command. See http://docs.djangoproject.com/en/dev/topics/testing/#id1