You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I run pytest and pipe it to less, if I ever quit less, pytest crashes and throws an exception. Could the exception not be handled so that if a pipe is broken pytest gracefully exits?
Just run pytest . | less
Pytest version: 5.3.2
Exception:
Traceback (most recent call last):
File "/usr/local/bin/pytest", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 92, in main
config=config
File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/usr/local/lib/python3.7/site-packages/_pytest/main.py", line 239, in pytest_cmdline_main
return wrap_session(config, _main)
File "/usr/local/lib/python3.7/site-packages/_pytest/main.py", line 232, in wrap_session
session=session, exitstatus=session.exitstatus
File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
gen.send(outcome)
File "/usr/local/lib/python3.7/site-packages/_pytest/terminal.py", line 692, in pytest_sessionfinish
terminalreporter=self, exitstatus=exitstatus, config=self.config
File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 182, in _multicall
next(gen) # first yield
File "/usr/local/lib/python3.7/site-packages/_pytest/terminal.py", line 706, in pytest_terminal_summary
self.summary_failures()
File "/usr/local/lib/python3.7/site-packages/_pytest/terminal.py", line 869, in summary_failures
self._outrep_summary(rep)
File "/usr/local/lib/python3.7/site-packages/_pytest/terminal.py", line 899, in _outrep_summary
self._tw.line(content)
File "/usr/local/lib/python3.7/site-packages/py/_io/terminalwriter.py", line 271, in line
self.write(s, **kw)
File "/usr/local/lib/python3.7/site-packages/py/_io/terminalwriter.py", line 256, in write
write_out(self._file, markupmsg)
File "/usr/local/lib/python3.7/site-packages/py/_io/terminalwriter.py", line 421, in write_out
fil.flush()
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
The text was updated successfully, but these errors were encountered:
Whenever I run pytest and pipe it to
less
, if I ever quit less, pytest crashes and throws an exception. Could the exception not be handled so that if a pipe is broken pytest gracefully exits?Just run
pytest . | less
Pytest version:
5.3.2
Exception:
The text was updated successfully, but these errors were encountered: