Skip to content

v0.5.3

Latest

Choose a tag to compare

@livingstaccato livingstaccato released this 09 Sep 22:40
b62a7a8

The pytest capture patch now decides for itself whether pytest needs it.

install_capture_swap_fix guarded only on the two methods still coming from _pytest.capture, which identifies another patcher and nothing else. A pytest carrying its own fix keeps those methods where they are, so the guard admits it and the patch lands on the corrected implementation, putting the sys.stdout reassignment back into a capture that had stopped doing it.

Installing measures instead: a real SysCapture is driven through swap, suspend and resume, and only a pytest that loses the swap is patched. A probe that cannot be driven reports no defect.

The _pytest.capture import also moved inside the call. At module scope it made a renamed or removed class an ImportError during plugin load, taking every suite that installs the plugin with it on a routine pytest bump.

Full notes in CHANGELOG.md.