Michael Foord added the comment:
Using the runner as a "context" passed to test cases (and accessible from
tests) for this kind of configuration seems like a good approach to me.
--
___
Python tracker
R. David Murray added the comment:
I like that approach as well, it is the kind of API I've been finding myself
writing a fair bit lately (a context passed to class instances that otherwise
don't store global state themselves).
--
___
Python
Robert Collins added the comment:
There's a few interacting things here. If I can suggest some design thoughts.
buffering within a test is I think really something we should offer a test
servicing API for. There are many thirdparty ones (e.g. I have one in fixtures)
- but it should be a
Changes by Demian Brecht demianbre...@gmail.com:
--
nosy: -demian.brecht
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +rbcollins
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list mailing
Serhiy Storchaka added the comment:
There is the verbose attribute of the test.support module.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
Ezio Melotti added the comment:
That only works for the CPython test suite (and it's not a public API).
FWIW I'm +1 on the idea, but I would have to see how it will get implemented in
a patch.
--
stage: - needs patch
___
Python tracker
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Serhiy Storchaka added the comment:
Usages of test.support.verbose should be replaced by self.verbosity.
As for output buffering, may be replace sys.stdout by file-like object which
flushes its buffered content to original stdout on failure and discard it on
success. Or add the self.log
Ezio Melotti added the comment:
As for output buffering, may be replace sys.stdout by file-like object
which flushes its buffered content to original stdout on failure and
discard it on success.
This is what the --buffer option is already supposed to do (I only found out
about it thanks to
Antoine Pitrou added the comment:
Indeed, I'm sorry for suggesting two features in one issue :-)
Feature #1 is self.verbosity (as a read-only variable) on test cases. Sounds
like a no-brainer, IMHO :-)
Feature #2 is selective enabling of the buffering feature in test cases. This
rather
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list
Michael Foord added the comment:
This seems like a reasonable improvement, I'd be in favour. I'd be *slightly*
concerned that a test can override an explicit verbosity setting of the user,
but I guess that annoyance is up to the test writer (they should check for an
explicit setting first).
Antoine Pitrou added the comment:
Oh, I'm only proposing read-only access to the verbosity information. And
forcing output buffering would only last for the current test method, of course.
--
___
Python tracker rep...@bugs.python.org
Michael Foord added the comment:
Yep. I have no qualms about allowing test cases to switch on buffering.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: +berker.peksag
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Changes by Demian Brecht demianbre...@gmail.com:
--
nosy: +demian.brecht
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
New submission from Antoine Pitrou:
Currently, test cases have no control over output and verbosity. I would
propose two possible enhancements:
- give the TestCase read access to the verbosity value (as e.g.
`self.verbosity`), to allow for conditional output in tests
- allow test methods to
Changes by Zachary Ware zachary.w...@gmail.com:
--
nosy: +zach.ware
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22197
___
___
Python-bugs-list
19 matches
Mail list logo