Skip to content

Stubtest: don't error if a module in a tests/ directory is missing from the stub - #15725

Closed
AlexWaygood wants to merge 1 commit into
python:masterfrom
AlexWaygood:stubtest-missing-tests
Closed

AlexWaygood wants to merge 1 commit into
python:masterfrom
AlexWaygood:stubtest-missing-tests

Conversation

@AlexWaygood

Copy link
Copy Markdown
Member

We have a quite a few allowlist entries in typeshed at the moment to get stubtest to stop complaining about tests/ directories being missing from the stubs. This PR fixes that.

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Good point.

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, this would interfere with our project: https://github.com/typeddjango/django-stubs/tree/master/django-stubs/test

Because, django.test is public, we want stubtest to raise warnings there.

I think it would be better to decide on a project basis.

@AlexWaygood

AlexWaygood commented Jul 21, 2023 •

Copy link
Copy Markdown
Member Author

It would still emit errors for modules in django.test that you have stubs for. It just wouldn't emit errors if any modules inside django.test are missing from the stub.

But yeah, I guess this is an unreliable heuristic, and should probably be decided per-project :/

@AlexWaygood
AlexWaygood deleted the stubtest-missing-tests branch July 21, 2023 08:08
@AlexWaygood
AlexWaygood restored the stubtest-missing-tests branch February 22, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants