Skip to content

Commit

Permalink
update some tests that use unreachable1.py since there are now more…
Browse files Browse the repository at this point in the history
… scenarios in it
  • Loading branch information
DetachHead committed Jun 25, 2024
1 parent 9f80bab commit 1b20e5e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/pyright-internal/src/tests/typeEvaluatorBased.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('reportUnreachable', () => {
configOptions.diagnosticRuleSet.reportUnreachable = 'error';
const analysisResults = typeAnalyzeSampleFiles(['unreachable1.py'], configOptions);
validateResultsButBased(analysisResults, {
errors: [78, 89, 106, 110].map((line) => ({ code: DiagnosticRule.reportUnreachable, line })),
errors: [78, 89, 106, 110, 118, 126].map((line) => ({ code: DiagnosticRule.reportUnreachable, line })),
infos: [{ line: 95 }, { line: 98 }],
unusedCodes: [{ line: 102 }],
});
Expand All @@ -36,12 +36,20 @@ test('default typeCheckingMode=all', () => {
const analysisResults = typeAnalyzeSampleFiles(['unreachable1.py'], configOptions);
validateResultsButBased(analysisResults, {
errors: [
...[78, 89, 106, 110].map((line) => ({ code: DiagnosticRule.reportUnreachable, line })),
...[78, 89, 106, 110, 118, 126].map((line) => ({ code: DiagnosticRule.reportUnreachable, line })),
{ line: 16, code: DiagnosticRule.reportUninitializedInstanceVariable },
{ line: 19, code: DiagnosticRule.reportUnknownParameterType },
{ line: 33, code: DiagnosticRule.reportUnknownParameterType },
{ line: 94, code: DiagnosticRule.reportUnnecessaryComparison },
{ line: 102, code: DiagnosticRule.reportUnusedVariable },
{ line: 113, code: DiagnosticRule.reportUnknownParameterType },
{ line: 113, code: DiagnosticRule.reportMissingTypeArgument },
{ line: 114, code: DiagnosticRule.reportUnnecessaryIsInstance },
{ line: 115, code: DiagnosticRule.reportUnknownVariableType },
{ line: 121, code: DiagnosticRule.reportUnknownParameterType },
{ line: 121, code: DiagnosticRule.reportMissingTypeArgument },
{ line: 122, code: DiagnosticRule.reportUnnecessaryIsInstance },
{ line: 123, code: DiagnosticRule.reportUnknownVariableType },
],
infos: [{ line: 95 }, { line: 98 }],
});
Expand Down

0 comments on commit 1b20e5e

Please sign in to comment.