@zzzen/pyright-internal 1.2.0-dev.20240428 → 1.2.0-dev.20240512
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/analyzerFileInfo.js +3 -2
- package/dist/analyzer/analyzerFileInfo.js.map +1 -1
- package/dist/analyzer/binder.js +6 -0
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/checker.js +62 -35
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/declaration.d.ts +1 -0
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/operations.js +3 -2
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/patternMatching.js +20 -14
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/scope.d.ts +4 -0
- package/dist/analyzer/scope.js +9 -2
- package/dist/analyzer/scope.js.map +1 -1
- package/dist/analyzer/sourceFile.js +13 -5
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +56 -17
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeGuards.d.ts +1 -1
- package/dist/analyzer/typeGuards.js +38 -19
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typeUtils.js +1 -5
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/types.js +8 -0
- package/dist/analyzer/types.js.map +1 -1
- package/dist/common/envVarUtils.js +1 -2
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/pythonVersion.d.ts +1 -0
- package/dist/common/pythonVersion.js +2 -1
- package/dist/common/pythonVersion.js.map +1 -1
- package/dist/languageServerBase.d.ts +3 -2
- package/dist/languageServerBase.js +13 -35
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.js +1 -1
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/dynamicFeature.d.ts +18 -0
- package/dist/languageService/dynamicFeature.js +54 -0
- package/dist/languageService/dynamicFeature.js.map +1 -0
- package/dist/languageService/fileWatcherDynamicFeature.d.ts +12 -0
- package/dist/languageService/fileWatcherDynamicFeature.js +49 -0
- package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -0
- package/dist/localization/package.nls.cs.json +28 -26
- package/dist/localization/package.nls.de.json +28 -26
- package/dist/localization/package.nls.en-us.json +2 -2
- package/dist/localization/package.nls.es.json +27 -25
- package/dist/localization/package.nls.fr.json +28 -26
- package/dist/localization/package.nls.it.json +28 -26
- package/dist/localization/package.nls.ja.json +28 -26
- package/dist/localization/package.nls.ko.json +28 -26
- package/dist/localization/package.nls.pl.json +27 -25
- package/dist/localization/package.nls.pt-br.json +28 -26
- package/dist/localization/package.nls.qps-ploc.json +25 -23
- package/dist/localization/package.nls.ru.json +28 -26
- package/dist/localization/package.nls.tr.json +28 -26
- package/dist/localization/package.nls.zh-cn.json +28 -26
- package/dist/localization/package.nls.zh-tw.json +28 -26
- package/dist/parser/tokenizer.js +7 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/tests/envVarUtils.test.js +20 -0
- package/dist/tests/envVarUtils.test.js.map +1 -1
- package/dist/tests/parser.test.js +7 -2
- package/dist/tests/parser.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +59 -479
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +4 -486
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +0 -604
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +1 -423
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator6.test.d.ts +1 -0
- package/dist/tests/typeEvaluator6.test.js +712 -0
- package/dist/tests/typeEvaluator6.test.js.map +1 -0
- package/dist/tests/typeEvaluator7.test.d.ts +1 -0
- package/dist/tests/typeEvaluator7.test.js +677 -0
- package/dist/tests/typeEvaluator7.test.js.map +1 -0
- package/dist/tests/typeEvaluator8.test.d.ts +1 -0
- package/dist/tests/typeEvaluator8.test.js +660 -0
- package/dist/tests/typeEvaluator8.test.js.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1,712 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* typeEvaluator6.test.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
* Author: Eric Traut
|
7
|
+
*
|
8
|
+
* Unit tests for pyright type evaluator. Tests are split
|
9
|
+
* arbitrarily among multiple files so they can run in parallel.
|
10
|
+
*/
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
12
|
+
if (k2 === undefined) k2 = k;
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
16
|
+
}
|
17
|
+
Object.defineProperty(o, k2, desc);
|
18
|
+
}) : (function(o, m, k, k2) {
|
19
|
+
if (k2 === undefined) k2 = k;
|
20
|
+
o[k2] = m[k];
|
21
|
+
}));
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
24
|
+
}) : function(o, v) {
|
25
|
+
o["default"] = v;
|
26
|
+
});
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
35
|
+
const configOptions_1 = require("../common/configOptions");
|
36
|
+
const pythonVersion_1 = require("../common/pythonVersion");
|
37
|
+
const uri_1 = require("../common/uri/uri");
|
38
|
+
const TestUtils = __importStar(require("./testUtils"));
|
39
|
+
test('Overload1', () => {
|
40
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload1.py']);
|
41
|
+
TestUtils.validateResults(analysisResults, 0);
|
42
|
+
});
|
43
|
+
test('Overload2', () => {
|
44
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload2.py']);
|
45
|
+
TestUtils.validateResults(analysisResults, 0);
|
46
|
+
});
|
47
|
+
test('Overload3', () => {
|
48
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload3.py']);
|
49
|
+
TestUtils.validateResults(analysisResults, 1);
|
50
|
+
});
|
51
|
+
test('Overload4', () => {
|
52
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload4.py']);
|
53
|
+
TestUtils.validateResults(analysisResults, 3);
|
54
|
+
});
|
55
|
+
test('Overload5', () => {
|
56
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
57
|
+
configOptions.diagnosticRuleSet.reportOverlappingOverload = 'none';
|
58
|
+
let analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload5.py'], configOptions);
|
59
|
+
TestUtils.validateResults(analysisResults, 0);
|
60
|
+
configOptions.diagnosticRuleSet.reportOverlappingOverload = 'error';
|
61
|
+
analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload5.py'], configOptions);
|
62
|
+
TestUtils.validateResults(analysisResults, 12);
|
63
|
+
});
|
64
|
+
test('Overload6', () => {
|
65
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload6.py']);
|
66
|
+
TestUtils.validateResults(analysisResults, 2);
|
67
|
+
});
|
68
|
+
test('Overload7', () => {
|
69
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload7.py']);
|
70
|
+
TestUtils.validateResults(analysisResults, 6);
|
71
|
+
});
|
72
|
+
test('Overload8', () => {
|
73
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload8.py']);
|
74
|
+
TestUtils.validateResults(analysisResults, 4);
|
75
|
+
});
|
76
|
+
test('Overload10', () => {
|
77
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload10.py']);
|
78
|
+
TestUtils.validateResults(analysisResults, 1);
|
79
|
+
});
|
80
|
+
test('Overload11', () => {
|
81
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload11.py']);
|
82
|
+
TestUtils.validateResults(analysisResults, 1);
|
83
|
+
});
|
84
|
+
test('Overload12', () => {
|
85
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload12.py']);
|
86
|
+
TestUtils.validateResults(analysisResults, 2);
|
87
|
+
});
|
88
|
+
test('Overload13', () => {
|
89
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload13.py']);
|
90
|
+
TestUtils.validateResults(analysisResults, 0);
|
91
|
+
});
|
92
|
+
test('Overload14', () => {
|
93
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload14.py']);
|
94
|
+
TestUtils.validateResults(analysisResults, 0);
|
95
|
+
});
|
96
|
+
test('Overload15', () => {
|
97
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload15.py']);
|
98
|
+
TestUtils.validateResults(analysisResults, 8);
|
99
|
+
});
|
100
|
+
test('Overload16', () => {
|
101
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload16.py']);
|
102
|
+
TestUtils.validateResults(analysisResults, 2);
|
103
|
+
});
|
104
|
+
test('Overload17', () => {
|
105
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['overload17.py']);
|
106
|
+
TestUtils.validateResults(analysisResults, 3);
|
107
|
+
});
|
108
|
+
test('TypeGuard1', () => {
|
109
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeGuard1.py']);
|
110
|
+
TestUtils.validateResults(analysisResults, 8);
|
111
|
+
});
|
112
|
+
test('TypeGuard2', () => {
|
113
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeGuard2.py']);
|
114
|
+
TestUtils.validateResults(analysisResults, 0);
|
115
|
+
});
|
116
|
+
test('TypeGuard3', () => {
|
117
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeGuard3.py']);
|
118
|
+
TestUtils.validateResults(analysisResults, 0);
|
119
|
+
});
|
120
|
+
test('TypeIs1', () => {
|
121
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeIs1.py']);
|
122
|
+
TestUtils.validateResults(analysisResults, 2);
|
123
|
+
});
|
124
|
+
test('Never1', () => {
|
125
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['never1.py']);
|
126
|
+
TestUtils.validateResults(analysisResults, 5);
|
127
|
+
});
|
128
|
+
test('Never2', () => {
|
129
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['never2.py']);
|
130
|
+
TestUtils.validateResults(analysisResults, 1);
|
131
|
+
});
|
132
|
+
test('TypePromotions1', () => {
|
133
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typePromotions1.py']);
|
134
|
+
TestUtils.validateResults(analysisResults, 0);
|
135
|
+
});
|
136
|
+
test('Index1', () => {
|
137
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['index1.py']);
|
138
|
+
TestUtils.validateResults(analysisResults, 10);
|
139
|
+
});
|
140
|
+
test('ProtocolModule2', () => {
|
141
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocolModule2.py']);
|
142
|
+
TestUtils.validateResults(analysisResults, 3);
|
143
|
+
});
|
144
|
+
test('ProtocolModule4', () => {
|
145
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocolModule4.py']);
|
146
|
+
TestUtils.validateResults(analysisResults, 1);
|
147
|
+
});
|
148
|
+
test('VariadicTypeVar1', () => {
|
149
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
150
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
151
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar1.py'], configOptions);
|
152
|
+
TestUtils.validateResults(analysisResults, 18);
|
153
|
+
});
|
154
|
+
test('VariadicTypeVar2', () => {
|
155
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
156
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
157
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar2.py'], configOptions);
|
158
|
+
TestUtils.validateResults(analysisResults, 15);
|
159
|
+
});
|
160
|
+
test('VariadicTypeVar3', () => {
|
161
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
162
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
163
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar3.py'], configOptions);
|
164
|
+
TestUtils.validateResults(analysisResults, 5);
|
165
|
+
});
|
166
|
+
test('VariadicTypeVar4', () => {
|
167
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
168
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
169
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar4.py'], configOptions);
|
170
|
+
TestUtils.validateResults(analysisResults, 4);
|
171
|
+
});
|
172
|
+
test('VariadicTypeVar5', () => {
|
173
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
174
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
175
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar5.py'], configOptions);
|
176
|
+
TestUtils.validateResults(analysisResults, 9);
|
177
|
+
});
|
178
|
+
test('VariadicTypeVar6', () => {
|
179
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
180
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
181
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar6.py'], configOptions);
|
182
|
+
TestUtils.validateResults(analysisResults, 10);
|
183
|
+
});
|
184
|
+
test('VariadicTypeVar7', () => {
|
185
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
186
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
187
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar7.py'], configOptions);
|
188
|
+
TestUtils.validateResults(analysisResults, 6);
|
189
|
+
});
|
190
|
+
test('VariadicTypeVar8', () => {
|
191
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
192
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
193
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar8.py'], configOptions);
|
194
|
+
TestUtils.validateResults(analysisResults, 5);
|
195
|
+
});
|
196
|
+
test('VariadicTypeVar9', () => {
|
197
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
198
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
199
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar9.py'], configOptions);
|
200
|
+
TestUtils.validateResults(analysisResults, 0);
|
201
|
+
});
|
202
|
+
test('VariadicTypeVar10', () => {
|
203
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
204
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
205
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar10.py'], configOptions);
|
206
|
+
TestUtils.validateResults(analysisResults, 2);
|
207
|
+
});
|
208
|
+
test('VariadicTypeVar11', () => {
|
209
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
210
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
211
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar11.py'], configOptions);
|
212
|
+
TestUtils.validateResults(analysisResults, 4);
|
213
|
+
});
|
214
|
+
test('VariadicTypeVar12', () => {
|
215
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
216
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
217
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar12.py'], configOptions);
|
218
|
+
TestUtils.validateResults(analysisResults, 0);
|
219
|
+
});
|
220
|
+
test('VariadicTypeVar13', () => {
|
221
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
222
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
223
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar13.py'], configOptions);
|
224
|
+
TestUtils.validateResults(analysisResults, 1);
|
225
|
+
});
|
226
|
+
test('VariadicTypeVar14', () => {
|
227
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
228
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
229
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar14.py'], configOptions);
|
230
|
+
TestUtils.validateResults(analysisResults, 6);
|
231
|
+
});
|
232
|
+
test('VariadicTypeVar15', () => {
|
233
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
234
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
235
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar15.py'], configOptions);
|
236
|
+
TestUtils.validateResults(analysisResults, 0);
|
237
|
+
});
|
238
|
+
test('VariadicTypeVar16', () => {
|
239
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
240
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
241
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar16.py'], configOptions);
|
242
|
+
TestUtils.validateResults(analysisResults, 0);
|
243
|
+
});
|
244
|
+
test('VariadicTypeVar17', () => {
|
245
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
246
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
247
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar17.py'], configOptions);
|
248
|
+
TestUtils.validateResults(analysisResults, 0);
|
249
|
+
});
|
250
|
+
test('VariadicTypeVar18', () => {
|
251
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
252
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
253
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar18.py'], configOptions);
|
254
|
+
TestUtils.validateResults(analysisResults, 2);
|
255
|
+
});
|
256
|
+
test('VariadicTypeVar19', () => {
|
257
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
258
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
259
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar19.py'], configOptions);
|
260
|
+
TestUtils.validateResults(analysisResults, 0);
|
261
|
+
});
|
262
|
+
test('VariadicTypeVar20', () => {
|
263
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
264
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
265
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar20.py'], configOptions);
|
266
|
+
TestUtils.validateResults(analysisResults, 0);
|
267
|
+
});
|
268
|
+
test('VariadicTypeVar21', () => {
|
269
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
270
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
271
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar21.py'], configOptions);
|
272
|
+
TestUtils.validateResults(analysisResults, 0);
|
273
|
+
});
|
274
|
+
test('VariadicTypeVar22', () => {
|
275
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
276
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
277
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar22.py'], configOptions);
|
278
|
+
TestUtils.validateResults(analysisResults, 3);
|
279
|
+
});
|
280
|
+
test('VariadicTypeVar23', () => {
|
281
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
282
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
283
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar23.py'], configOptions);
|
284
|
+
TestUtils.validateResults(analysisResults, 0);
|
285
|
+
});
|
286
|
+
test('VariadicTypeVar24', () => {
|
287
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
288
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
289
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar24.py'], configOptions);
|
290
|
+
TestUtils.validateResults(analysisResults, 0);
|
291
|
+
});
|
292
|
+
test('VariadicTypeVar25', () => {
|
293
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
294
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
295
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar25.py'], configOptions);
|
296
|
+
TestUtils.validateResults(analysisResults, 0);
|
297
|
+
});
|
298
|
+
test('VariadicTypeVar26', () => {
|
299
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
300
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
301
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar26.py'], configOptions);
|
302
|
+
TestUtils.validateResults(analysisResults, 3);
|
303
|
+
});
|
304
|
+
test('VariadicTypeVar27', () => {
|
305
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
306
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
307
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar27.py'], configOptions);
|
308
|
+
TestUtils.validateResults(analysisResults, 1);
|
309
|
+
});
|
310
|
+
test('VariadicTypeVar28', () => {
|
311
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
312
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
|
313
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar28.py'], configOptions);
|
314
|
+
TestUtils.validateResults(analysisResults, 0);
|
315
|
+
});
|
316
|
+
test('VariadicTypeVar29', () => {
|
317
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
318
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_12;
|
319
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['variadicTypeVar29.py'], configOptions);
|
320
|
+
TestUtils.validateResults(analysisResults, 0);
|
321
|
+
});
|
322
|
+
test('Match1', () => {
|
323
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
324
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
325
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['match1.py'], configOptions);
|
326
|
+
TestUtils.validateResults(analysisResults, 21);
|
327
|
+
});
|
328
|
+
test('Match2', () => {
|
329
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
330
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
331
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['match2.py'], configOptions);
|
332
|
+
TestUtils.validateResults(analysisResults, 2);
|
333
|
+
});
|
334
|
+
test('Match3', () => {
|
335
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
336
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
337
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['match3.py'], configOptions);
|
338
|
+
TestUtils.validateResults(analysisResults, 0);
|
339
|
+
});
|
340
|
+
test('MatchSequence1', () => {
|
341
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
342
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
343
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchSequence1.py'], configOptions);
|
344
|
+
TestUtils.validateResults(analysisResults, 2);
|
345
|
+
});
|
346
|
+
test('MatchClass1', () => {
|
347
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
348
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
349
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass1.py'], configOptions);
|
350
|
+
TestUtils.validateResults(analysisResults, 5);
|
351
|
+
});
|
352
|
+
test('MatchClass2', () => {
|
353
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
354
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
355
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass2.py'], configOptions);
|
356
|
+
TestUtils.validateResults(analysisResults, 0);
|
357
|
+
});
|
358
|
+
test('MatchClass3', () => {
|
359
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
360
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
361
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass3.py'], configOptions);
|
362
|
+
TestUtils.validateResults(analysisResults, 0);
|
363
|
+
});
|
364
|
+
test('MatchClass4', () => {
|
365
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
366
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
367
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass4.py'], configOptions);
|
368
|
+
TestUtils.validateResults(analysisResults, 0);
|
369
|
+
});
|
370
|
+
test('MatchClass5', () => {
|
371
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
372
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
373
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass5.py'], configOptions);
|
374
|
+
TestUtils.validateResults(analysisResults, 5);
|
375
|
+
});
|
376
|
+
test('MatchClass6', () => {
|
377
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
378
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
379
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass6.py'], configOptions);
|
380
|
+
TestUtils.validateResults(analysisResults, 0);
|
381
|
+
});
|
382
|
+
test('MatchValue1', () => {
|
383
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
384
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
385
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchValue1.py'], configOptions);
|
386
|
+
TestUtils.validateResults(analysisResults, 0);
|
387
|
+
});
|
388
|
+
test('MatchMapping1', () => {
|
389
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
390
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
391
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchMapping1.py'], configOptions);
|
392
|
+
TestUtils.validateResults(analysisResults, 2);
|
393
|
+
});
|
394
|
+
test('MatchLiteral1', () => {
|
395
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
396
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
397
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchLiteral1.py'], configOptions);
|
398
|
+
TestUtils.validateResults(analysisResults, 0);
|
399
|
+
});
|
400
|
+
test('MatchLiteral2', () => {
|
401
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
402
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
403
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchLiteral2.py'], configOptions);
|
404
|
+
TestUtils.validateResults(analysisResults, 0);
|
405
|
+
});
|
406
|
+
test('MatchExhaustion1', () => {
|
407
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
408
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
409
|
+
configOptions.diagnosticRuleSet.reportMatchNotExhaustive = 'none';
|
410
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['matchExhaustion1.py'], configOptions);
|
411
|
+
TestUtils.validateResults(analysisResults1, 0);
|
412
|
+
configOptions.diagnosticRuleSet.reportMatchNotExhaustive = 'error';
|
413
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['matchExhaustion1.py'], configOptions);
|
414
|
+
TestUtils.validateResults(analysisResults2, 4);
|
415
|
+
});
|
416
|
+
test('MatchUnnecessary1', () => {
|
417
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
418
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
419
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['matchUnnecessary1.py'], configOptions);
|
420
|
+
TestUtils.validateResults(analysisResults1, 0);
|
421
|
+
configOptions.diagnosticRuleSet.reportUnnecessaryComparison = 'error';
|
422
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['matchUnnecessary1.py'], configOptions);
|
423
|
+
TestUtils.validateResults(analysisResults2, 7);
|
424
|
+
});
|
425
|
+
test('List1', () => {
|
426
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['list1.py']);
|
427
|
+
TestUtils.validateResults(analysisResults, 3);
|
428
|
+
});
|
429
|
+
test('List2', () => {
|
430
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['list2.py']);
|
431
|
+
TestUtils.validateResults(analysisResults, 0);
|
432
|
+
});
|
433
|
+
test('List3', () => {
|
434
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['list3.py']);
|
435
|
+
TestUtils.validateResults(analysisResults, 0);
|
436
|
+
});
|
437
|
+
test('Comparison1', () => {
|
438
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
439
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['comparison1.py'], configOptions);
|
440
|
+
TestUtils.validateResults(analysisResults1, 0);
|
441
|
+
configOptions.diagnosticRuleSet.reportUnnecessaryComparison = 'error';
|
442
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['comparison1.py'], configOptions);
|
443
|
+
TestUtils.validateResults(analysisResults2, 7);
|
444
|
+
});
|
445
|
+
test('Comparison2', () => {
|
446
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
447
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['comparison2.py'], configOptions);
|
448
|
+
TestUtils.validateResults(analysisResults1, 0);
|
449
|
+
configOptions.diagnosticRuleSet.reportUnnecessaryComparison = 'error';
|
450
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['comparison2.py'], configOptions);
|
451
|
+
TestUtils.validateResults(analysisResults2, 11);
|
452
|
+
});
|
453
|
+
test('EmptyContainers1', () => {
|
454
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['emptyContainers1.py']);
|
455
|
+
TestUtils.validateResults(analysisResults, 5);
|
456
|
+
});
|
457
|
+
test('InitSubclass1', () => {
|
458
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['initsubclass1.py']);
|
459
|
+
TestUtils.validateResults(analysisResults, 6);
|
460
|
+
});
|
461
|
+
test('InitSubclass2', () => {
|
462
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['initsubclass2.py']);
|
463
|
+
TestUtils.validateResults(analysisResults, 2);
|
464
|
+
});
|
465
|
+
test('None1', () => {
|
466
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['none1.py']);
|
467
|
+
TestUtils.validateResults(analysisResults, 1);
|
468
|
+
});
|
469
|
+
test('None2', () => {
|
470
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['none2.py']);
|
471
|
+
TestUtils.validateResults(analysisResults, 2);
|
472
|
+
});
|
473
|
+
test('Constructor1', () => {
|
474
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor1.py']);
|
475
|
+
TestUtils.validateResults(analysisResults, 0);
|
476
|
+
});
|
477
|
+
test('Constructor2', () => {
|
478
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor2.py']);
|
479
|
+
TestUtils.validateResults(analysisResults, 0);
|
480
|
+
});
|
481
|
+
test('Constructor3', () => {
|
482
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor3.py']);
|
483
|
+
TestUtils.validateResults(analysisResults, 0);
|
484
|
+
});
|
485
|
+
test('Constructor4', () => {
|
486
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor4.py']);
|
487
|
+
TestUtils.validateResults(analysisResults, 1);
|
488
|
+
});
|
489
|
+
test('Constructor5', () => {
|
490
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor5.py']);
|
491
|
+
TestUtils.validateResults(analysisResults, 0);
|
492
|
+
});
|
493
|
+
test('Constructor6', () => {
|
494
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor6.py']);
|
495
|
+
TestUtils.validateResults(analysisResults, 0, 1);
|
496
|
+
});
|
497
|
+
test('Constructor7', () => {
|
498
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor7.py']);
|
499
|
+
TestUtils.validateResults(analysisResults, 0);
|
500
|
+
});
|
501
|
+
test('Constructor9', () => {
|
502
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor9.py']);
|
503
|
+
TestUtils.validateResults(analysisResults, 0);
|
504
|
+
});
|
505
|
+
test('Constructor10', () => {
|
506
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor10.py']);
|
507
|
+
TestUtils.validateResults(analysisResults, 0);
|
508
|
+
});
|
509
|
+
test('Constructor11', () => {
|
510
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor11.py']);
|
511
|
+
TestUtils.validateResults(analysisResults, 0);
|
512
|
+
});
|
513
|
+
test('Constructor12', () => {
|
514
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor12.py']);
|
515
|
+
TestUtils.validateResults(analysisResults, 0);
|
516
|
+
});
|
517
|
+
test('Constructor13', () => {
|
518
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor13.py']);
|
519
|
+
TestUtils.validateResults(analysisResults, 1);
|
520
|
+
});
|
521
|
+
test('Constructor14', () => {
|
522
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor14.py']);
|
523
|
+
TestUtils.validateResults(analysisResults, 0);
|
524
|
+
});
|
525
|
+
test('Constructor15', () => {
|
526
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor15.py']);
|
527
|
+
TestUtils.validateResults(analysisResults, 0);
|
528
|
+
});
|
529
|
+
test('Constructor16', () => {
|
530
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor16.py']);
|
531
|
+
TestUtils.validateResults(analysisResults, 2);
|
532
|
+
});
|
533
|
+
test('Constructor17', () => {
|
534
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor17.py']);
|
535
|
+
TestUtils.validateResults(analysisResults, 0);
|
536
|
+
});
|
537
|
+
test('Constructor18', () => {
|
538
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor18.py']);
|
539
|
+
TestUtils.validateResults(analysisResults, 0);
|
540
|
+
});
|
541
|
+
test('Constructor19', () => {
|
542
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor19.py']);
|
543
|
+
TestUtils.validateResults(analysisResults, 1);
|
544
|
+
});
|
545
|
+
test('Constructor20', () => {
|
546
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor20.py']);
|
547
|
+
TestUtils.validateResults(analysisResults, 2);
|
548
|
+
});
|
549
|
+
test('Constructor21', () => {
|
550
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor21.py']);
|
551
|
+
TestUtils.validateResults(analysisResults, 2);
|
552
|
+
});
|
553
|
+
test('Constructor22', () => {
|
554
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor22.py']);
|
555
|
+
TestUtils.validateResults(analysisResults, 0);
|
556
|
+
});
|
557
|
+
test('Constructor23', () => {
|
558
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor23.py']);
|
559
|
+
TestUtils.validateResults(analysisResults, 0);
|
560
|
+
});
|
561
|
+
test('Constructor24', () => {
|
562
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
563
|
+
configOptions.diagnosticRuleSet.strictParameterNoneValue = false;
|
564
|
+
let analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor24.py'], configOptions);
|
565
|
+
TestUtils.validateResults(analysisResults, 4);
|
566
|
+
configOptions.diagnosticRuleSet.strictParameterNoneValue = true;
|
567
|
+
analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor24.py'], configOptions);
|
568
|
+
TestUtils.validateResults(analysisResults, 5);
|
569
|
+
});
|
570
|
+
test('Constructor25', () => {
|
571
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor25.py']);
|
572
|
+
TestUtils.validateResults(analysisResults, 1);
|
573
|
+
});
|
574
|
+
test('Constructor26', () => {
|
575
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor26.py']);
|
576
|
+
TestUtils.validateResults(analysisResults, 8);
|
577
|
+
});
|
578
|
+
test('Constructor27', () => {
|
579
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor27.py']);
|
580
|
+
TestUtils.validateResults(analysisResults, 0);
|
581
|
+
});
|
582
|
+
test('Constructor28', () => {
|
583
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor28.py']);
|
584
|
+
TestUtils.validateResults(analysisResults, 1);
|
585
|
+
});
|
586
|
+
test('Constructor29', () => {
|
587
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor29.py']);
|
588
|
+
TestUtils.validateResults(analysisResults, 0);
|
589
|
+
});
|
590
|
+
test('ConstructorCallable1', () => {
|
591
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructorCallable1.py']);
|
592
|
+
TestUtils.validateResults(analysisResults, 4);
|
593
|
+
});
|
594
|
+
test('ConstructorCallable2', () => {
|
595
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructorCallable2.py']);
|
596
|
+
TestUtils.validateResults(analysisResults, 0);
|
597
|
+
});
|
598
|
+
test('InconsistentConstructor1', () => {
|
599
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
600
|
+
configOptions.diagnosticRuleSet.reportInconsistentConstructor = 'none';
|
601
|
+
let analysisResults = TestUtils.typeAnalyzeSampleFiles(['inconsistentConstructor1.py'], configOptions);
|
602
|
+
TestUtils.validateResults(analysisResults, 0);
|
603
|
+
// Enable it as an error.
|
604
|
+
configOptions.diagnosticRuleSet.reportInconsistentConstructor = 'error';
|
605
|
+
analysisResults = TestUtils.typeAnalyzeSampleFiles(['inconsistentConstructor1.py'], configOptions);
|
606
|
+
TestUtils.validateResults(analysisResults, 2);
|
607
|
+
});
|
608
|
+
test('ClassGetItem1', () => {
|
609
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classGetItem1.py']);
|
610
|
+
TestUtils.validateResults(analysisResults, 0, 1);
|
611
|
+
});
|
612
|
+
test('UnusedCallResult1', () => {
|
613
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
614
|
+
// By default, this is disabled.
|
615
|
+
let analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedCallResult1.py'], configOptions);
|
616
|
+
TestUtils.validateResults(analysisResults, 0);
|
617
|
+
// Enable it as an error.
|
618
|
+
configOptions.diagnosticRuleSet.reportUnusedCallResult = 'error';
|
619
|
+
analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedCallResult1.py'], configOptions);
|
620
|
+
TestUtils.validateResults(analysisResults, 4);
|
621
|
+
});
|
622
|
+
test('UnusedCoroutine1', () => {
|
623
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['unusedCoroutine1.py']);
|
624
|
+
TestUtils.validateResults(analysisResults, 2);
|
625
|
+
});
|
626
|
+
test('FunctionAnnotation1', () => {
|
627
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['functionAnnotation1.py']);
|
628
|
+
TestUtils.validateResults(analysisResults, 1);
|
629
|
+
});
|
630
|
+
test('FunctionAnnotation2', () => {
|
631
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['functionAnnotation2.py']);
|
632
|
+
TestUtils.validateResults(analysisResults, 4);
|
633
|
+
});
|
634
|
+
test('FunctionAnnotation3', () => {
|
635
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['functionAnnotation3.py']);
|
636
|
+
TestUtils.validateResults(analysisResults, 2);
|
637
|
+
});
|
638
|
+
test('FunctionAnnotation4', () => {
|
639
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
640
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['functionAnnotation4.py'], configOptions);
|
641
|
+
TestUtils.validateResults(analysisResults1, 0);
|
642
|
+
configOptions.diagnosticRuleSet.reportTypeCommentUsage = 'error';
|
643
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['functionAnnotation4.py'], configOptions);
|
644
|
+
TestUtils.validateResults(analysisResults2, 3);
|
645
|
+
});
|
646
|
+
test('Subscript1', () => {
|
647
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
648
|
+
// Analyze with Python 3.8 settings.
|
649
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_8;
|
650
|
+
const analysisResults38 = TestUtils.typeAnalyzeSampleFiles(['subscript1.py'], configOptions);
|
651
|
+
TestUtils.validateResults(analysisResults38, 18);
|
652
|
+
// Analyze with Python 3.8 settings.
|
653
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
654
|
+
const analysisResults39 = TestUtils.typeAnalyzeSampleFiles(['subscript1.py'], configOptions);
|
655
|
+
TestUtils.validateResults(analysisResults39, 0);
|
656
|
+
});
|
657
|
+
test('Subscript2', () => {
|
658
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['subscript2.py']);
|
659
|
+
TestUtils.validateResults(analysisResults, 8);
|
660
|
+
});
|
661
|
+
test('Subscript3', () => {
|
662
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
663
|
+
// Analyze with Python 3.9 settings.
|
664
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_9;
|
665
|
+
const analysisResults39 = TestUtils.typeAnalyzeSampleFiles(['subscript3.py'], configOptions);
|
666
|
+
TestUtils.validateResults(analysisResults39, 37);
|
667
|
+
// Analyze with Python 3.10 settings.
|
668
|
+
// These are disabled because PEP 637 was rejected.
|
669
|
+
// configOptions.defaultPythonVersion = pythonVersion3_10;
|
670
|
+
// const analysisResults310 = TestUtils.typeAnalyzeSampleFiles(['subscript3.py'], configOptions);
|
671
|
+
// TestUtils.validateResults(analysisResults310, 11);
|
672
|
+
});
|
673
|
+
test('Subscript4', () => {
|
674
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['subscript4.py']);
|
675
|
+
TestUtils.validateResults(analysisResults, 0);
|
676
|
+
});
|
677
|
+
test('Decorator1', () => {
|
678
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator1.py']);
|
679
|
+
TestUtils.validateResults(analysisResults, 0);
|
680
|
+
});
|
681
|
+
test('Decorator2', () => {
|
682
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator2.py']);
|
683
|
+
TestUtils.validateResults(analysisResults, 0);
|
684
|
+
});
|
685
|
+
test('Decorator3', () => {
|
686
|
+
const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
|
687
|
+
// Analyze with Python 3.8 settings.
|
688
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_8;
|
689
|
+
const analysisResults38 = TestUtils.typeAnalyzeSampleFiles(['decorator3.py'], configOptions);
|
690
|
+
TestUtils.validateResults(analysisResults38, 3);
|
691
|
+
// Analyze with Python 3.8 settings.
|
692
|
+
configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
|
693
|
+
const analysisResults39 = TestUtils.typeAnalyzeSampleFiles(['decorator3.py'], configOptions);
|
694
|
+
TestUtils.validateResults(analysisResults39, 0);
|
695
|
+
});
|
696
|
+
test('Decorator4', () => {
|
697
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator4.py']);
|
698
|
+
TestUtils.validateResults(analysisResults, 0);
|
699
|
+
});
|
700
|
+
test('Decorator5', () => {
|
701
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator5.py']);
|
702
|
+
TestUtils.validateResults(analysisResults, 0);
|
703
|
+
});
|
704
|
+
test('Decorator6', () => {
|
705
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator6.py']);
|
706
|
+
TestUtils.validateResults(analysisResults, 0);
|
707
|
+
});
|
708
|
+
test('Decorator7', () => {
|
709
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['decorator7.py']);
|
710
|
+
TestUtils.validateResults(analysisResults, 0);
|
711
|
+
});
|
712
|
+
//# sourceMappingURL=typeEvaluator6.test.js.map
|