-
-
Couldn't load subscription status.
- Fork 2.9k
Open
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
Description
# test_a.py
def test_foo(request):
reporter = request.config.pluginmanager.getplugin("terminalreporter")
reporter.ensure_newline()
reporter.write("magic", flush=True)If you run the above file through pytest nothing is written on the output.
$ pytest .
platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/workdir
plugins: print-0.3.0
collected 1 item
test_a.py . [100%]Though I'd expect something like:
$ pytest .
platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/workdir
plugins: print-0.3.0
collected 1 item
test_a.py
magic .
[100%]Note if you remove the flush we do get the message printed, but without respecting the ensure newline (instead you get test_a.py magic.).
Metadata
Metadata
Assignees
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously