terminalwriter: don't flush implicitly; add explicit flushes
Flushing on every write is somewhat expensive. Rely on line buffering instead (if line buffering for stdout is disabled, there must be some reason...), and add explicit flushes when not outputting lines. This is how regular `print()` e.g. work so should be familiar.
This commit is contained in:
@@ -68,6 +68,8 @@ def _show_fixture_action(fixturedef, msg):
|
||||
if hasattr(fixturedef, "cached_param"):
|
||||
tw.write("[{}]".format(fixturedef.cached_param))
|
||||
|
||||
tw.flush()
|
||||
|
||||
if capman:
|
||||
capman.resume_global_capture()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user