summaryrefslogtreecommitdiff
path: root/src/_pytest/runner.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/runner.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/runner.py')
-rw-r--r--src/_pytest/runner.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py
index f87ccb461..76785ada7 100644
--- a/src/_pytest/runner.py
+++ b/src/_pytest/runner.py
@@ -120,6 +120,7 @@ def show_test_item(item):
used_fixtures = sorted(getattr(item, "fixturenames", []))
if used_fixtures:
tw.write(" (fixtures used: {})".format(", ".join(used_fixtures)))
+ tw.flush()
def pytest_runtest_setup(item):