The CLI entry point of pytest (internal). This is the real implementation used by entry points and ``__main__.py``.
()
| 244 | |
| 245 | |
| 246 | def _console_main() -> int: |
| 247 | """The CLI entry point of pytest (internal). |
| 248 | |
| 249 | This is the real implementation used by entry points and ``__main__.py``. |
| 250 | """ |
| 251 | # https://docs.python.org/3/library/signal.html#note-on-sigpipe |
| 252 | try: |
| 253 | code = _main(prog=_get_prog_name(sys.argv)) |
| 254 | sys.stdout.flush() |
| 255 | return code |
| 256 | except BrokenPipeError: |
| 257 | # Python flushes standard streams on exit; redirect remaining output |
| 258 | # to devnull to avoid another BrokenPipeError at shutdown |
| 259 | devnull = os.open(os.devnull, os.O_WRONLY) |
| 260 | os.dup2(devnull, sys.stdout.fileno()) |
| 261 | return 1 # Python exits with error code 1 on EPIPE |
| 262 | |
| 263 | |
| 264 | def console_main() -> int: |
no test coverage detected