Skip to content

[DO-NOT-MERGE] Checking to see if pyright verifies third-party test cases against false negatives correctly #9623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jan 30, 2023

If our test-case setup is working correctly, pyright should error out with a complaint about an unused type: ignore comment.

@AlexWaygood
Copy link
Member Author

Anybody have any ideas how to get pyright to emit an error on the unused type: ignore here? None of my ideas seem to work (see each commit in isolation for what I've tried).

@Avasam
Copy link
Collaborator

Avasam commented Jan 30, 2023

Weird, locally on main:
python .\tests\pyright_test.py .\stubs\invoke\@tests -p .\pyrightconfig.testcases.json works as expected, but
python .\tests\pyright_test.py -p .\pyrightconfig.testcases.json does not

@AlexWaygood
Copy link
Member Author

Maybe it's something specific to do with how pyright-action invokes pyright

@Avasam
Copy link
Collaborator

Avasam commented Jan 30, 2023

Maybe it's something specific to do with how pyright-action invokes pyright

It's the same if I call pyright directly: pyright .\stubs\invoke\@tests -p .\pyrightconfig.testcases.json

@Avasam
Copy link
Collaborator

Avasam commented Jan 30, 2023

Ok, the ** path just isn't working
It works if I use:

    "include": [
        "stubs/invoke/@tests/test_cases",
    ],

Edit: bissected to be a regression in 1.1.284
Likely because of

Bug Fix (from pylance): Fixed exclude/include to work with '.' prefixed directories.

npx pyright@1.1.283 -p .\pyrightconfig.testcases.json works fine with wildcard paths

Edit 2: What I saw from 1.1.283 is unrelated.

@AlexWaygood
Copy link
Member Author

Amazing, thanks for the investigation! I'll be AFK for a few hours, but I'll see about filing a bug report to pyright later if you don't beat me to it ;)

@Avasam
Copy link
Collaborator

Avasam commented Jan 30, 2023

Nvm the bisect part, I celebrated too early and didn't realize the errors I was getting were from a different file. :/

But what I said about using the direct path working is still true. So if it's broken, it's been broken since forever. I've open an issue with a minimal reproduction: microsoft/pyright#4553

@Avasam
Copy link
Collaborator

Avasam commented Feb 1, 2023

A fix has been released! https://github.com/microsoft/pyright/releases/tag/1.1.292
Not sure if you'd like to use this PR or a new one to start clean. But adding test_cases subfolders to the base and stricter configs' exclude is a good call.

@AlexWaygood
Copy link
Member Author

A fix has been released! https://github.com/microsoft/pyright/releases/tag/1.1.292 Not sure if you'd like to use this PR or a new one to start clean. But adding test_cases subfolders to the base and stricter configs' exclude is a good call.

Brilliant. I opened #9646 for the pyright bump.

@AlexWaygood
Copy link
Member Author

Closing in favour of #9650

@AlexWaygood AlexWaygood closed this Feb 1, 2023
@AlexWaygood AlexWaygood deleted the AlexWaygood-patch-1 branch February 1, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants