@@ -203,7 +203,7 @@ import nonexistent
203
203
None + ''
204
204
[out]
205
205
main:1: error: Cannot find module named 'nonexistent'
206
- main:1: note: (Perhaps setting MYPYPATH would help)
206
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
207
207
main:2: error: Unsupported left operand type for + (None)
208
208
209
209
[case testTypeCheckWithUnknownModule2]
@@ -215,7 +215,7 @@ m.x = ''
215
215
x = 1
216
216
[out]
217
217
main:1: error: Cannot find module named 'nonexistent'
218
- main:1: note: (Perhaps setting MYPYPATH would help)
218
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
219
219
main:2: error: Unsupported left operand type for + (None)
220
220
main:4: error: Incompatible types in assignment (expression has type "str", variable has type "int")
221
221
@@ -228,7 +228,7 @@ m.x = ''
228
228
x = 1
229
229
[out]
230
230
main:1: error: Cannot find module named 'nonexistent'
231
- main:1: note: (Perhaps setting MYPYPATH would help)
231
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
232
232
main:2: error: Unsupported left operand type for + (None)
233
233
main:4: error: Incompatible types in assignment (expression has type "str", variable has type "int")
234
234
@@ -237,7 +237,7 @@ import nonexistent, another
237
237
None + ''
238
238
[out]
239
239
main:1: error: Cannot find module named 'nonexistent'
240
- main:1: note: (Perhaps setting MYPYPATH would help)
240
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
241
241
main:1: error: Cannot find module named 'another'
242
242
main:2: error: Unsupported left operand type for + (None)
243
243
@@ -246,23 +246,23 @@ import nonexistent as x
246
246
None + ''
247
247
[out]
248
248
main:1: error: Cannot find module named 'nonexistent'
249
- main:1: note: (Perhaps setting MYPYPATH would help)
249
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
250
250
main:2: error: Unsupported left operand type for + (None)
251
251
252
252
[case testTypeCheckWithUnknownModuleUsingFromImport]
253
253
from nonexistent import x
254
254
None + ''
255
255
[out]
256
256
main:1: error: Cannot find module named 'nonexistent'
257
- main:1: note: (Perhaps setting MYPYPATH would help)
257
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
258
258
main:2: error: Unsupported left operand type for + (None)
259
259
260
260
[case testTypeCheckWithUnknownModuleUsingImportStar]
261
261
from nonexistent import *
262
262
None + ''
263
263
[out]
264
264
main:1: error: Cannot find module named 'nonexistent'
265
- main:1: note: (Perhaps setting MYPYPATH would help)
265
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
266
266
main:2: error: Unsupported left operand type for + (None)
267
267
268
268
[case testAccessingUnknownModule]
@@ -271,15 +271,15 @@ xyz.foo()
271
271
xyz()
272
272
[out]
273
273
main:1: error: Cannot find module named 'xyz'
274
- main:1: note: (Perhaps setting MYPYPATH would help)
274
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
275
275
276
276
[case testAccessingUnknownModule2]
277
277
import xyz, bar
278
278
xyz.foo()
279
279
bar()
280
280
[out]
281
281
main:1: error: Cannot find module named 'xyz'
282
- main:1: note: (Perhaps setting MYPYPATH would help)
282
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
283
283
main:1: error: Cannot find module named 'bar'
284
284
285
285
[case testAccessingUnknownModule3]
@@ -288,7 +288,7 @@ xyz.foo()
288
288
z()
289
289
[out]
290
290
main:1: error: Cannot find module named 'xyz'
291
- main:1: note: (Perhaps setting MYPYPATH would help)
291
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
292
292
main:2: error: Name 'xyz' is not defined
293
293
294
294
[case testAccessingNameImportedFromUnknownModule]
@@ -297,14 +297,14 @@ y.foo()
297
297
z()
298
298
[out]
299
299
main:1: error: Cannot find module named 'xyz'
300
- main:1: note: (Perhaps setting MYPYPATH would help)
300
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
301
301
302
302
[case testAccessingNameImportedFromUnknownModule2]
303
303
from xyz import *
304
304
y
305
305
[out]
306
306
main:1: error: Cannot find module named 'xyz'
307
- main:1: note: (Perhaps setting MYPYPATH would help)
307
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
308
308
main:2: error: Name 'y' is not defined
309
309
310
310
[case testAccessingNameImportedFromUnknownModule3]
313
313
z
314
314
[out]
315
315
main:1: error: Cannot find module named 'xyz'
316
- main:1: note: (Perhaps setting MYPYPATH would help)
316
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
317
317
main:2: error: Name 'y' is not defined
318
318
319
319
[case testUnknownModuleRedefinition]
320
320
import xab
321
321
def xab(): pass
322
322
[out]
323
323
main:1: error: Cannot find module named 'xab'
324
- main:1: note: (Perhaps setting MYPYPATH would help)
324
+ main:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
325
325
326
326
[case testAccessingUnknownModuleFromOtherModule]
327
327
import x
@@ -333,7 +333,7 @@ import nonexistent
333
333
[out]
334
334
main:1: note: In module imported here:
335
335
tmp/x.py:1: error: Cannot find module named 'nonexistent'
336
- tmp/x.py:1: note: (Perhaps setting MYPYPATH would help)
336
+ tmp/x.py:1: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
337
337
main:3: error: "module" has no attribute "z"
338
338
339
339
[case testUnknownModuleImportedWithinFunction]
@@ -343,7 +343,7 @@ def foobar(): pass
343
343
foobar('')
344
344
[out]
345
345
main:2: error: Cannot find module named 'foobar'
346
- main:2: note: (Perhaps setting MYPYPATH would help)
346
+ main:2: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
347
347
main:4: error: Too many arguments for "foobar"
348
348
349
349
[case testUnknownModuleImportedWithinFunction2]
@@ -353,7 +353,7 @@ def x(): pass
353
353
x('')
354
354
[out]
355
355
main:2: error: Cannot find module named 'foobar'
356
- main:2: note: (Perhaps setting MYPYPATH would help)
356
+ main:2: note: (Perhaps setting MYPYPATH or using the "--silent-imports" flag would help)
357
357
main:4: error: Too many arguments for "x"
358
358
359
359
[case testRelativeImports]
0 commit comments