Skip to content

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

Closed
AlexWaygood wants to merge 11 commits into
mainfrom
AlexWaygood-patch-1
Closed

[DO-NOT-MERGE] Checking to see if pyright verifies third-party test cases against false negatives correctly#9623
AlexWaygood wants to merge 11 commits into
mainfrom
AlexWaygood-patch-1

Conversation

@AlexWaygood

@AlexWaygoodAlexWaygood commented Jan 30, 2023

Copy link
Copy Markdown
Member

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

@AlexWaygood

Copy link
Copy Markdown
MemberAuthor

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

Avasam commented Jan 30, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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

@Avasam

Copy link
Copy Markdown
Collaborator

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

Avasam commented Jan 30, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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

Avasam commented Jan 30, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator

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
Copy Markdown
MemberAuthor

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.

Comment threadpyrightconfig.json Outdated
@AlexWaygood

Copy link
Copy Markdown
MemberAuthor

Closing in favour of #9650

@AlexWaygood
AlexWaygood deleted the AlexWaygood-patch-1 branch February 1, 2023 15:13
Sign up for freeto 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

@AlexWaygood@Avasam