[Django] #27430: `manage.py test` does not support unittest `-b` buffer option

16 views
Skip to first unread message

Django

unread,
Nov 4, 2016, 1:15:05 AM11/4/16
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
---------------------------------------------+------------------------
Reporter: Paul Tiplady | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
Unittest supports buffering of test output, such that passing tests do not
spam stdout/stderr with output. This is the default behaviour for
nosetests, as well.

I can't see any way to enable this behaviour in `manage.py test`. Has
adding support for this flag been considered?

Currently my workaround is to use nosetests (with django-nose), but that
test runner appears to be [bugged](https://github.com/django-nose/django-
nose/issues/276) WRT the new `--parallel` flag, so it's not a perfect
solution.

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

Django

unread,
Nov 4, 2016, 1:15:38 AM11/4/16
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-----------------------------------+--------------------------------------

Reporter: Paul Tiplady | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by Paul Tiplady:

Old description:

> Unittest supports buffering of test output, such that passing tests do
> not spam stdout/stderr with output. This is the default behaviour for
> nosetests, as well.
>
> I can't see any way to enable this behaviour in `manage.py test`. Has
> adding support for this flag been considered?
>
> Currently my workaround is to use nosetests (with django-nose), but that
> test runner appears to be [bugged](https://github.com/django-nose/django-
> nose/issues/276) WRT the new `--parallel` flag, so it's not a perfect
> solution.

New description:

Unittest supports buffering of test output with the `-b` flag, such that


passing tests do not spam stdout/stderr with output. This is the default
behaviour for nosetests, as well.

I can't see any way to enable this behaviour in `manage.py test`. Has
adding support for this flag been considered?

Currently my workaround is to use nosetests (with django-nose), but that
test runner appears to be [bugged](https://github.com/django-nose/django-
nose/issues/276) WRT the new `--parallel` flag, so it's not a perfect
solution.

--

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

Django

unread,
Nov 4, 2016, 1:16:37 AM11/4/16
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-----------------------------------+--------------------------------------

Reporter: Paul Tiplady | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by Paul Tiplady:

Old description:

> Unittest supports buffering of test output with the `-b` flag, such that


> passing tests do not spam stdout/stderr with output. This is the default
> behaviour for nosetests, as well.
>
> I can't see any way to enable this behaviour in `manage.py test`. Has
> adding support for this flag been considered?
>
> Currently my workaround is to use nosetests (with django-nose), but that
> test runner appears to be [bugged](https://github.com/django-nose/django-
> nose/issues/276) WRT the new `--parallel` flag, so it's not a perfect
> solution.

New description:

Unittest supports buffering of test output with the `-b` flag, such that


passing tests do not spam stdout/stderr with output. This is the default
behaviour for nosetests, as well.

I can't see any way to enable this behaviour in `manage.py test`. Has
adding support for this flag been considered?

Currently my workaround is to use nosetests (with django-nose), but that

test runner appears to be [https://github.com/django-nose/django-
nose/issues/276 bugged] WRT the new `--parallel` flag, so it's not a
perfect solution.

--

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

Django

unread,
Nov 5, 2016, 7:08:04 AM11/5/16
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-----------------------------------+------------------------------------

Reporter: Paul Tiplady | Owner: nobody
Type: New feature | Status: new

Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by jackieleng):

* cc: jackieleng (added)
* type: Uncategorized => New feature
* stage: Unreviewed => Accepted


Comment:

Verified on master, there is no -b option or any option that seems to work
the same way.

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

Django

unread,
Nov 5, 2016, 12:10:48 PM11/5/16
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-----------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Eyad Toma
Type: New feature | Status: assigned

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

* owner: nobody => Eyad Toma
* status: new => assigned


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

Django

unread,
Mar 1, 2017, 2:30:36 PM3/1/17
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-----------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Eyad Toma
Type: New feature | Status: assigned
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------------------

Comment (by Mads Jensen):

There is a humble, yet incomplete attempt at this in
https://github.com/atombrella/django/commit/4ada8bb0000106982f2cd5fb11e5ccdc278aa1c8
in case someone wants to complete it.

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

Django

unread,
Oct 2, 2017, 1:59:13 AM10/2/17
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-----------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Eyad Toma
Type: New feature | Status: assigned
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------------------
Changes (by Hugo Osvaldo Barrera):

* cc: Hugo Osvaldo Barrera (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:6>

Django

unread,
Dec 2, 2019, 5:54:36 AM12/2/19
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-------------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Baptiste
| Mispelon

Type: New feature | Status: assigned
Component: Testing framework | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* owner: Eyad Toma => Baptiste Mispelon
* has_patch: 0 => 1
* version: 1.10 => master


Comment:

[https://github.com/django/django/pull/12169 PR here]

As noted in the PR, I couldn't figure out how to make the option work when
running the tests in parallel.
Python's unittest implements the `--buffer` feature on its 'TestResult`
class but Django reimplements that class from scratch in the case of
parallel tests.

It might be possible to re-add all the stdout/stderr manupulation that
Python does but even then I'm not sure how modifying `sys.stdout` would
interact with `multiprocessing` (is it safe to do so?).

I didn't add any tests because I couldn't find examples in the existing
test suite of how to construct a test case for this behavior.
(I used #30676 as a base to build this PR and it didn't come with tests
either, but maybe that one was harder to test so it's more justified than
for this ticket)

--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:7>

Django

unread,
Dec 9, 2019, 4:41:26 AM12/9/19
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-------------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Baptiste
| Mispelon
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:8>

Django

unread,
Dec 9, 2019, 8:21:05 AM12/9/19
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-------------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Baptiste
| Mispelon
Type: New feature | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"9e565386d3fafc8cc15d07095e50d574e5f53802" 9e565386]:
{{{
#!CommitTicketReference repository=""
revision="9e565386d3fafc8cc15d07095e50d574e5f53802"
Fixed #27430 -- Added -b/--buffer option to DiscoverRunner.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:9>

Django

unread,
Jul 10, 2020, 1:28:49 PM7/10/20
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-------------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Baptiste
| Mispelon
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"188f7786bc434a3e5ca7b46d2975a08318fe7452" 188f7786]:
{{{
#!CommitTicketReference repository=""
revision="188f7786bc434a3e5ca7b46d2975a08318fe7452"
Refs #27430 -- Added buffer argument to DiscoverRunner docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:10>

Django

unread,
Jul 10, 2020, 1:29:51 PM7/10/20
to django-...@googlegroups.com
#27430: `manage.py test` does not support unittest `-b` buffer option
-------------------------------------+-------------------------------------
Reporter: Paul Tiplady | Owner: Baptiste
| Mispelon
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"7045fa7f7ac049b41e9a891c213dd7f55bedab1f" 7045fa7f]:
{{{
#!CommitTicketReference repository=""
revision="7045fa7f7ac049b41e9a891c213dd7f55bedab1f"
[3.1.x] Refs #27430 -- Added buffer argument to DiscoverRunner docs.

Backport of 188f7786bc434a3e5ca7b46d2975a08318fe7452 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:11>

Reply all
Reply to author
Forward
0 new messages