[Django] #12191: It's not possible to run a specific test if it's not in models.py or tests.py (e.g. when using suites)

0 views
Skip to first unread message

Django

unread,
Nov 8, 2009, 11:14:16 PM11/8/09
to djang...@holovaty.com, django-...@googlegroups.com
#12191: It's not possible to run a specific test if it's not in models.py or
tests.py (e.g. when using suites)
---------------------------------+------------------------------------------
Reporter: dolapo | Owner: nobody
Status: new | Milestone:
Component: Testing framework | Version: 1.1
Keywords: testing test | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
---------------------------------+------------------------------------------
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.

--
Ticket URL: <http://code.djangoproject.com/ticket/12191>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 8, 2009, 11:18:21 PM11/8/09
to djang...@holovaty.com, django-...@googlegroups.com
#12191: It's not possible to run a specific test if it's not in models.py or
tests.py (e.g. when using suites)
----------------------------------------+-----------------------------------
Reporter: dolapo | Owner: dolapo
Status: assigned | Milestone:
Component: Testing framework | Version: 1.1
Resolution: | Keywords: testing test
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
----------------------------------------+-----------------------------------
Changes (by dolapo):

* owner: nobody => dolapo
* status: new => assigned

Comment:

Since I screwed up the formatting in the description, this patch adds to
the simple test runner the ability to run tests as:[[BR]]

{{{
app.module.TestCase.test_method
app.module.TestCase.*
}}}

--
Ticket URL: <http://code.djangoproject.com/ticket/12191#comment:1>

Django

unread,
Jan 24, 2010, 2:48:49 PM1/24/10
to djang...@holovaty.com, django-...@googlegroups.com
#12191: It's not possible to run a specific test if it's not in models.py or
tests.py (e.g. when using suites)
----------------------------------------+-----------------------------------
Reporter: dolapo | Owner: dolapo
Status: assigned | Milestone:
Component: Testing framework | Version: 1.1
Resolution: | Keywords: testing test
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
----------------------------------------+-----------------------------------
Comment (by mapleoin):

This looks more like a documentation bug to me, you can replace `tests.py`
with a `tests` python package and you can have as many submodules as you
want in different files in that package as explained in the
[http://docs.python.org/tutorial/modules.html#packages Python docs].

I'm attaching a documentation patch.

--
Ticket URL: <http://code.djangoproject.com/ticket/12191#comment:2>

Django

unread,
Feb 4, 2010, 11:00:16 AM2/4/10
to djang...@holovaty.com, django-...@googlegroups.com
#12191: It's not possible to run a specific test if it's not in models.py or
tests.py (e.g. when using suites)
----------------------------------------+-----------------------------------
Reporter: dolapo | Owner: dolapo
Status: assigned | Milestone:
Component: Testing framework | Version: 1.1
Resolution: | Keywords: testing test
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
----------------------------------------+-----------------------------------
Changes (by ericholscher):

* stage: Unreviewed => Accepted

--
Ticket URL: <http://code.djangoproject.com/ticket/12191#comment:3>

Django

unread,
Apr 1, 2011, 9:26:29 PM4/1/11
to djang...@holovaty.com, django-...@googlegroups.com
#12191: It's not possible to run a specific test if it's not in models.py or
tests.py (e.g. when using suites)
-------------------------------------+-------------------------------------
Reporter: dolapo | Owner: dolapo
Type: | Status: assigned
Cleanup/optimization | Component: Testing framework
Milestone: | Severity: Normal
Version: 1.1 | Keywords: testing test
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 |
Patch needs improvement: 1 |
-------------------------------------+-------------------------------------
Changes (by mattmcc):

* type: => Cleanup/optimization
* severity: => Normal


--
Ticket URL: <http://code.djangoproject.com/ticket/12191#comment:4>

Reply all
Reply to author
Forward
0 new messages