Skip to content

Add regression tests for sentinel conditional type guards - #11686

Merged
Rich Chiodo (rchiodo) merged 1 commit into
microsoft:mainfrom
Viicos:vp/sentinels-regression-tests
Aug 28, 2026
Merged

Rich Chiodo (rchiodo) merged 1 commit into
microsoft:mainfrom
Viicos:vp/sentinels-regression-tests

Conversation

@Viicos

Copy link
Copy Markdown
Contributor

Regression tests for #11115, which was fixed by #11676.

@bschnurr

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

@bschnurr

Copy link
Copy Markdown
Member

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Result: could-not-verify

Summary: The PR adds regression coverage to the existing `Sentinel1` and `Sentinel2` tests for sentinel attribute lookup and conditional narrowing of instance attributes. No tests ran because the isolated verification container could not start. Verification therefore remains blocked, with no uncovered new behavior identified.

Test runs: 1 not run

  • ⚠️ Not run | Sentinel regression discovery and preflight | git status --short && git diff --name-status upstream/main...HEAD && git diff --unified=20 upstream/main...HEAD -- packages/pyright-internal/src/tests/samples/sentinel1.py packages/pyright-internal/src/tests/samples/sentinel2.py && git grep -n "sentinel1|sentinel2" upstream/main...HEAD -- packages/pyright-internal/src/tests && if [ -d packages/pyright-internal/node_modules ]; then echo "DEPS_PRESENT=1"; else echo "DEPS_PRESENT=0"; fi && node -e "const p=require('./packages/pyright-internal/package.json'); console.log(JSON.stringify(p.scripts,null,2))"
⚠️ Sentinel regression discovery and preflight diagnostic output
Container verification could not start: no trusted sandbox image is configured for microsoft/pyright, and local execution was not authorized for this PR HEAD.

@bschnurr Bill Schnurr (bschnurr) 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.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:approved Automated review: no blocking findings (approval posted). label Aug 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@rchiodo
Rich Chiodo (rchiodo) merged commit 5a958ca into microsoft:main Aug 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants