summaryrefslogtreecommitdiffstats
path: root/library/python/pytest
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-09-02 11:39:17 +0300
committerrobot-piglet <[email protected]>2025-09-02 12:11:07 +0300
commitcecd8d9462e9c1a58aeae25894aac3e9fa2e2e3a (patch)
treec6ec848ab309e8f59251bcb65e0004a9d716d115 /library/python/pytest
parent6b86d7dc64358c875dd5e7f92be10f2abe866511 (diff)
Intermediate changes
commit_hash:3226aa9d9f0af82e14a84916ce0f450ded26504f
Diffstat (limited to 'library/python/pytest')
-rw-r--r--library/python/pytest/plugins/ya.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py
index 9afb02185c7..8b763af783b 100644
--- a/library/python/pytest/plugins/ya.py
+++ b/library/python/pytest/plugins/ya.py
@@ -341,7 +341,9 @@ def _graceful_shutdown(*args):
library.python.coverage.stop_coverage_tracing()
except ImportError:
pass
- traceback.print_stack(file=sys.stderr)
+ stack = traceback.format_stack()
+ # NOTE: Using os.write because it's reentrant, Python I/O stack isn't https://bugs.python.org/issue24283
+ os.write(sys.stderr.fileno(), b''.join(item.encode() for item in stack))
capman = pytest_config.pluginmanager.getplugin("capturemanager")
capman.suspend(in_=True)
_graceful_shutdown_on_log(not capman.is_globally_capturing())