python / python/mypy

Stderr in regular tests should probably go to out as well

Open
#19,554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic-developer topic-tests
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

[out] in regular tests should probably include stderr as well.

Recently, while making https://github.com/python/mypy/pull/19494, I learned that normal tests do not account for errors that go to stderr instead of stdout. This should be fixed, if possible (without performance penalty, so that normal tests can run a broader swath of tests.

This would allow more tests to be moved from slow cmdline tests to fast normal tests, à la https://github.com/python/mypy/issues/5966

I tried mucking about with the invocation of build.build in what struck me as the obvious ways, but even though I was able to get various ---------------------------- Captured stderr call ----------------------------- messages to pop off, I couldn't get the stderr to actually go into [out], even in a very crude way.

I'm not sure about how all this is plumbed, but it seems to me there's a minimal risk of erroneous stderr output messing up unrelated tests with false positives (or are they false negatives?), if we did have this working.

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 tracing how regular tests invoke build.build and how [out] currently captures output, then compare that path with the referenced slow command-line tests. Done means stderr is included in [out] for regular tests without a performance penalty, enabling suitable tests to move to the faster path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.