python / python/mypy

There are no tests for mypy.plugins.proper_plugin

Open
#19,890 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

There don't seem to be any tests for mypy.plugins.proper_plugin, which was manually tested for its addition in https://github.com/python/mypy/pull/16036.

Since mypy apparently owns this code, we should test it.

I've figured out this works as a unit test except that we can't import mypy.types in a unit test.

[case properPlugin]
# flags: --config=tmp/foo.ini
from mypy.types import Type, CallableType
result: Type | None = None
isinstance(result, CallableType)                      
[file foo.ini]
\[mypy]
plugins=mypy.plugins.proper_plugin
[builtins fixtures/isinstancelist.pyi]

I've recently realized this plugin parents its notes wrong, so I'd like to include a regression test for that, but I am having a hard time figuring out how to trigger it.

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 mypy.plugins.proper_plugin and the supplied unit-test case, then investigate how to trigger the incorrectly parented notes behavior. Confirm how the mypy.types import limitation affects the test setup, and consider the work done when tests cover the plugin and the regression scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, testing-qa
Issue type
Feature
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.