pytest-dev / pytest-dev/pytest

optimize io capture setup/teardown

Open
#2,205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

plugin: capture
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

this is a followup to #401

one perceived issue was that

fd-level capturing takes >10 percent. It's performed for each setup, call and teardown phase of a test and it's known to not be very efficient because it tries too hard to remain compatible to pytest-capturelog. I believe we should aim at integrating the pytest-capturelog plugin and simplify and speed up capturing.

there are various way to work with this

many pure python projects for example don't need fd capture and would benefit from opting for sys-capture per default

we could for example add a ini option to select the capture mode

also different strategies for setting up the fds and the related objects could help in general

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing pytest I/O capture implementation and the follow-up context in issue #401. Compare the proposed capture modes and file-descriptor setup strategies, then establish benchmarks and a concrete acceptance scope before attempting the refactor.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.