Feature Request: Separate `stderr` from `stdout` in `execute` function
- Dominant language
- Python
- Stars
- 489
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Thanks for your work on this project! It's incredibly useful!
However, I noticed that the `execute` function merges the `stderr` output of the container into `stdout`.
https://github.com/avast/pytest-docker/blob/d8939c8c44c8c18c91bbe5615914ccd64f7b63a2/src/pytest_docker/plugin.py#L27
This makes it difficult to distinguish between standard output and error messages. This makes things partically tricky when working with structured outputs (say, JSON), where warnings that can be ignored are printed to standard error. Merged output can't be decoded and it's challenging to filter-out warning messages.
Would it be possible to modify the `execute` function, to return `stdout` and `stderr` separately, or provide an option to keep them distinct? This would greatly improve usability when handling container output.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at src/pytest_docker/plugin.py around the linked execute function and inspect how container output is currently collected and returned. Determine the existing API expectations before choosing between separate streams or an opt-in distinction; done means callers can reliably distinguish stdout from stderr, including structured output and warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- devops, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100