#6712: choosing tests with command line among tests provided by custom 'suite'
method
----------------------+-----------------------------------------------------
Reporter: alainD | Owner: nobody
Status: new | Component: Unit test system
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
----------------------+-----------------------------------------------------
Changes (by russellm):
* needs_better_patch: 0 => 1
* stage: Design decision needed => Accepted
Comment:
Not wrong - just different, and I didn't parse the ticket title correctly.
I haven't been in the habit of using suite(); I just add from
``test_module import *`` to the tests/__init__.py for each of my test
module. This puts all the test cases into the myapp.tests module, so the
dot notation works.
Marking as 'needs improvement' because of two potential issues that I need
to mull over in my mind (feel free to comment on these):
1. _get_all_tests_from_suite() could be used to replace the two getattr
calls that are used to extract single tests. This suggests that there
could be some refactoring around build_test. (i.e., is build_test even
necessary? Can we just build the suite, and extract the tests we need if a
dotted name is provided?)
2. _get_all_tests_from_suite() flattens the test namespace. I'm not
completely convinced this is a good idea. I'm not convinced it's a bad
idea, either - I'm just a little hesitant to remove namespaces unless I
can be convinced that name clashes aren't a likely consequence.
Regarding 2: my immediate counter-reaction is that we should be looking to
integrate the dot notation for specifying tests with the heirarchical
structure of suites. However, I can't think of an obvious way to do this.
Alternatively, we can fix this as documentation by recommending (at a
documentation level) that suites not be heirarchical. This wouldn't be the
ideal solution, but in the absence of a good solution for the general
case, it may be the best we can do.
--
Ticket URL: <http://code.djangoproject.com/ticket/6712#comment:4>
Django Code <http://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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---