Open
Description
I have to suspend the global capture, because I ask the user for some user input in my pytest plugin.
But this leads to a changed terminal width.
conftest.py
import pytest
import shutil
@pytest.hookimpl(trylast=True)
def pytest_sessionfinish(session):
capture = session.config.pluginmanager.getplugin("capturemanager")
capture.suspend_global_capture(in_=True)
# some code to read user input
print(shutil.get_terminal_size())
capture.resume_global_capture()
print(shutil.get_terminal_size())
The ===
in the no tests ran line are shorter than above and the result of get_terminal_size
changed.
pytest: 8.3.5
os: Debian
I performed this test in a directory that only contained the specified file conftest.py
.