[Django] #26976: Make it easier to change what LiveServerThread class is used

8 vues
Accéder directement au premier message non lu

Django

non lue,
31 juil. 2016, 13:57:5231/07/2016
à django-...@googlegroups.com
#26976: Make it easier to change what LiveServerThread class is used
-------------------------------+--------------------
Reporter: cjerdonek | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Currently, it's not so easy to use a modified `LiveServerThread` inside
`LiveServerTestCase`. This is because `LiveServerTestCase` instantiates a
`LiveServerThread` object inside `_create_server_thread()` (see
[https://github.com/django/django/blob/5fa4370543658aedd79dc554d8c52684d6c7cbca/django/test/testcases.py#L1323
here] for a direct link to the code) and "hard codes" the class name:

{{{#!python
@classmethod
def _create_server_thread(cls, connections_override):
return LiveServerThread(
cls.host,
cls.static_handler,
connections_override=connections_override,
)
}}}

An easy solution would be to add a
`LiveServerTestCase.server_thread_class` class attribute, similar to how
other classes are handled throughout the test framework code to allow
easier subclassing.

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

Django

non lue,
1 août 2016, 08:06:1501/08/2016
à django-...@googlegroups.com
#26976: Make it easier to change what LiveServerThread class is used
--------------------------------------+------------------------------------
Reporter: cjerdonek | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* component: Uncategorized => Testing framework
* needs_tests: => 0
* easy: 0 => 1
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

I suppose no tests or docs are needed for that.

--
Ticket URL: <https://code.djangoproject.com/ticket/26976#comment:1>

Django

non lue,
1 août 2016, 13:46:1101/08/2016
à django-...@googlegroups.com
#26976: Make it easier to change what LiveServerThread class is used
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: cjerdonek
Type: | Status: assigned
Cleanup/optimization |

Component: Testing framework | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by cjerdonek):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/26976#comment:2>

Django

non lue,
1 août 2016, 14:34:2201/08/2016
à django-...@googlegroups.com
#26976: Make it easier to change what LiveServerThread class is used
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: cjerdonek
Type: | Status: assigned
Cleanup/optimization |
Component: Testing framework | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by cjerdonek):

I posted a pull request [https://github.com/django/django/pull/6998 here].

I also ran the following test command to make sure it works (and confirmed
that some of these tests fail if the change was made incorrectly):

{{{
$ ./runtests.py --parallel 1 servers.tests
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26976#comment:3>

Django

non lue,
1 août 2016, 14:36:2801/08/2016
à django-...@googlegroups.com
#26976: Make it easier to change what LiveServerThread class is used
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: cjerdonek
Type: | Status: assigned
Cleanup/optimization |
Component: Testing framework | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by cjerdonek):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/26976#comment:4>

Django

non lue,
1 août 2016, 16:15:5501/08/2016
à django-...@googlegroups.com
#26976: Make it easier to change what LiveServerThread class is used
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: cjerdonek
Type: | Status: closed

Cleanup/optimization |
Component: Testing framework | Version: 1.9
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"013ee21cf8e1a4b05589c161039f244e356272ba" 013ee21]:
{{{
#!CommitTicketReference repository=""
revision="013ee21cf8e1a4b05589c161039f244e356272ba"
Fixed #26976 -- Added LiveServerTestCase.server_thread_class to ease
subclassing.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26976#comment:5>

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message