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: Manoj Govindan <egmanoj@…> 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)

test_suite.1.diff (2.4 KB ) - added by Filip Gruszczyński 15 years ago.
Early version of using test suites in tests
test_suite.3.diff (2.4 KB ) - added by Filip Gruszczyński 15 years ago.
better patch

Download all attachments as: .zip

Change History (11)

comment:1 by Manoj Govindan <egmanoj@…>, 15 years ago

comment:2 by Michael Malone, 15 years ago

Resolution: invalid
Status: newclosed

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

in reply to:  2 comment:3 by Manoj Govindan <egmanoj@…>, 15 years ago

Resolution: invalid
Status: closedreopened

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 Michael Malone, 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 Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:6 by Filip Gruszczyński, 15 years ago

Owner: changed from nobody to Filip Gruszczyński
Status: reopenednew

by Filip Gruszczyński, 15 years ago

Attachment: test_suite.1.diff added

Early version of using test suites in tests

comment:7 by Filip Gruszczyński, 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.

by Filip Gruszczyński, 15 years ago

Attachment: test_suite.3.diff added

better patch

comment:8 by Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:9 by Ramiro Morales, 13 years ago

Easy pickings: unset
Resolution: duplicate
Status: newclosed

Duplicate of #6712.

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