#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: Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------+-----------------------------------------------------
Comment (by alainD2 <http://code.djangoproject.com/>):
My layout is like this :
myapp/tests is full of test files defining one or many TestCase classes
... and the myapp/tests/\_\_init\_\_.py is :
{{{
import unittest,os
MOD_LOCATION = 'myapp/tests/'
def suite_all():
suite = unittest.TestSuite()
list_mod = [name[:-2] for name in os.listdir(MOD_LOCATION) if
name.startswith('test_') and name.endswith('.py')]
for mod in list_mod:
the_mod = __import__(MOD_LOCATION + mod)
tests = unittest.defaultTestLoader.loadTestsFromModule(the_mod)
suite.addTests(tests)
return suite
def suite():
return suite_all()
}}}
I provide the suite function for django to be able to pick my tests ...
but they aren't addressable by the dot notation ...
Am I doing something wrong here ?
--
Ticket URL: <http://code.djangoproject.com/ticket/6712#comment:3>
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
-~----------~----~----~----~------~----~------~--~---