python / python/mypy

Make command line tests faster

Open
#5,966 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good-first-issue priority-0-high topic-developer topic-tests
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Command line tests in test-data/unit/cmdline.test are very slow since they use full typeshed stubs and run mypy in a subprocess. It looks like many of them would be easy to migrate to be normal type checker tests, or some of then could be even regular Python unit tests. Alternatively, we could perhaps use test stubs with them.

Speeding up report generation tests may also be easy.

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 with test-data/unit/cmdline.test and measure which command-line tests spend time using full typeshed stubs and a mypy subprocess. Identify tests that can become normal type checker or Python unit tests, and consider whether test stubs help; also inspect report generation tests. Done means the relevant tests retain coverage while running faster.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, performance, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.