summaryrefslogtreecommitdiff
path: root/src/_pytest/setuponly.py
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2020-04-29 17:58:33 +0300
committerRan Benita <ran@unusedvar.com>2020-04-30 16:44:03 +0300
commit1bc4170e63ca430a4f5e8532a53a71a060d115fa (patch)
treea19c31c9f1e6da24f18374c1e5306bbbdaa2beab /src/_pytest/setuponly.py
parentd9b43647b792ed71d92946edee17ded5d86eb6dc (diff)
downloadpytest-1bc4170e63ca430a4f5e8532a53a71a060d115fa.tar.gz
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.
Diffstat (limited to 'src/_pytest/setuponly.py')
-rw-r--r--src/_pytest/setuponly.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/_pytest/setuponly.py b/src/_pytest/setuponly.py
index aa5a95ff9..c9cc589ff 100644
--- a/src/_pytest/setuponly.py
+++ b/src/_pytest/setuponly.py
@@ -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()