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.
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>
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>
* 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>
* owner: nobody => Eyad Toma
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:4>
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>
* cc: Hugo Osvaldo Barrera (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:6>
* 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>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/27430#comment:8>
* 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>
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>
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>