diff --git a/changelog/7135.breaking.rst b/changelog/7135.breaking.rst new file mode 100644 index 000000000..4d5df4e40 --- /dev/null +++ b/changelog/7135.breaking.rst @@ -0,0 +1,15 @@ +Pytest now uses its own ``TerminalWriter`` class instead of using the one from the ``py`` library. +Plugins generally access this class through ``TerminalReporter.writer``, ``TerminalReporter.write()`` +(and similar methods), or ``_pytest.config.create_terminal_writer()``. + +The following breaking changes were made: + +- Output (``write()`` method and others) no longer flush implicitly; the flushing behavior + of the underlying file is respected. To flush explicitly (for example, if you + want output to be shown before an end-of-line is printed), use ``write(flush=True)`` or + ``terminal_writer.flush()``. +- Explicit Windows console support was removed, delegated to the colorama library. +- Support for writing ``bytes`` was removed. +- The ``reline`` method and ``chars_on_current_line`` property were removed. +- The ``stringio`` and ``encoding`` arguments was removed. +- Support for passing a callable instead of a file was removed.