From 1b20e5ec83ab8fce0e3be1fb2bae55f8f62da552 Mon Sep 17 00:00:00 2001 From: detachhead Date: Wed, 26 Jun 2024 05:51:08 +1000 Subject: [PATCH] update some tests that use `unreachable1.py` since there are now more scenarios in it --- .../src/tests/typeEvaluatorBased.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/pyright-internal/src/tests/typeEvaluatorBased.test.ts b/packages/pyright-internal/src/tests/typeEvaluatorBased.test.ts index 25df65504b..3b40a45351 100644 --- a/packages/pyright-internal/src/tests/typeEvaluatorBased.test.ts +++ b/packages/pyright-internal/src/tests/typeEvaluatorBased.test.ts @@ -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 }], }); @@ -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 }], });