Skip to content

Commit f3528f9

Browse files
committed
Update tests to use double quotes around module name
1 parent 0fd28c1 commit f3528f9

17 files changed

+177
-177
lines changed

test-data/unit/check-custom-plugin.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ tmp/mypy.ini:2: error: Can't find plugin 'tmp/missing.py'
7070
\[mypy]
7171
plugins=missing
7272
[out]
73-
tmp/mypy.ini:2: error: Error importing plugin 'missing': No module named 'missing'
73+
tmp/mypy.ini:2: error: Error importing plugin 'missing': No module named "missing"
7474

7575
[case testMultipleSectionsDefinePlugin]
7676
# flags: --config-file tmp/mypy.ini

test-data/unit/check-errorcodes.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,13 @@ if int() is str(): # E: Non-overlapping identity check (left operand type: "int
499499
[builtins fixtures/primitives.pyi]
500500

501501
[case testErrorCodeMissingModule]
502-
from defusedxml import xyz # E: Cannot find implementation or library stub for module named 'defusedxml' [import] \
502+
from defusedxml import xyz # E: Cannot find implementation or library stub for module named "defusedxml" [import] \
503503
# N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
504-
from nonexistent import foobar # E: Cannot find implementation or library stub for module named 'nonexistent' [import]
505-
import nonexistent2 # E: Cannot find implementation or library stub for module named 'nonexistent2' [import]
506-
from nonexistent3 import * # E: Cannot find implementation or library stub for module named 'nonexistent3' [import]
504+
from nonexistent import foobar # E: Cannot find implementation or library stub for module named "nonexistent" [import]
505+
import nonexistent2 # E: Cannot find implementation or library stub for module named "nonexistent2" [import]
506+
from nonexistent3 import * # E: Cannot find implementation or library stub for module named "nonexistent3" [import]
507507
from pkg import bad # E: Module 'pkg' has no attribute 'bad' [attr-defined]
508-
from pkg.bad2 import bad3 # E: Cannot find implementation or library stub for module named 'pkg.bad2' [import]
508+
from pkg.bad2 import bad3 # E: Cannot find implementation or library stub for module named "pkg.bad2" [import]
509509
[file pkg/__init__.py]
510510

511511
[case testErrorCodeAlreadyDefined]

test-data/unit/check-flags.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ main:2: note: (Using --follow-imports=error, module not passed on command line)
453453
[case testIgnoreMissingImportsFalse]
454454
from mod import x
455455
[out]
456-
main:1: error: Cannot find implementation or library stub for module named 'mod'
456+
main:1: error: Cannot find implementation or library stub for module named "mod"
457457
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
458458

459459
[case testIgnoreMissingImportsTrue]
@@ -610,7 +610,7 @@ from missing import MyType
610610
def f(x: MyType) -> None:
611611
pass
612612
[out]
613-
main:2: error: Cannot find implementation or library stub for module named 'missing'
613+
main:2: error: Cannot find implementation or library stub for module named "missing"
614614
main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
615615
main:4: error: Argument 1 to "f" becomes "Any" due to an unfollowed import
616616

test-data/unit/check-incremental.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ x = 1
21352135
[rechecked n]
21362136
[stale]
21372137
[out2]
2138-
tmp/n.py:1: error: Cannot find implementation or library stub for module named 'm'
2138+
tmp/n.py:1: error: Cannot find implementation or library stub for module named "m"
21392139
tmp/n.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
21402140

21412141
[case testDeleteFileWithinCycle]
@@ -3433,7 +3433,7 @@ import a
34333433
[out1]
34343434

34353435
[out2]
3436-
main:2: error: Cannot find implementation or library stub for module named 'a'
3436+
main:2: error: Cannot find implementation or library stub for module named "a"
34373437
main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
34383438

34393439
[case testIncrementalInheritanceAddAnnotation]
@@ -3576,7 +3576,7 @@ def f() -> None: pass
35763576
def f(x: int) -> None: pass
35773577
[out]
35783578
[out2]
3579-
main:1: error: Cannot find implementation or library stub for module named 'p.q'
3579+
main:1: error: Cannot find implementation or library stub for module named "p.q"
35803580
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
35813581
[out3]
35823582
main:2: error: Too few arguments for "f"
@@ -4198,10 +4198,10 @@ def __getattr__(attr: str) -> Any: ...
41984198
# empty
41994199
[builtins fixtures/module.pyi]
42004200
[out]
4201-
tmp/c.py:1: error: Cannot find implementation or library stub for module named 'a.b.c'
4201+
tmp/c.py:1: error: Cannot find implementation or library stub for module named "a.b.c"
42024202
tmp/c.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
42034203
[out2]
4204-
tmp/c.py:1: error: Cannot find implementation or library stub for module named 'a.b.c'
4204+
tmp/c.py:1: error: Cannot find implementation or library stub for module named "a.b.c"
42054205
tmp/c.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
42064206

42074207
[case testAddedMissingStubs]

test-data/unit/check-literal.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ func(f) # E: Argument 1 to "func" has incompatible type "Union[Literal['foo'],
867867
[case testLiteralDisallowAny]
868868
from typing import Any
869869
from typing_extensions import Literal
870-
from missing_module import BadAlias # E: Cannot find implementation or library stub for module named 'missing_module' \
870+
from missing_module import BadAlias # E: Cannot find implementation or library stub for module named "missing_module" \
871871
# N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
872872

873873
a: Literal[Any] # E: Parameter 1 of Literal[...] cannot be of type "Any"

test-data/unit/check-modules.test

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ else:
208208
import nonexistent
209209
None + ''
210210
[out]
211-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
211+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
212212
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
213213
main:2: error: Unsupported left operand type for + ("None")
214214

@@ -220,7 +220,7 @@ m.x = ''
220220
[file m.py]
221221
x = 1
222222
[out]
223-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
223+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
224224
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
225225
main:2: error: Unsupported left operand type for + ("None")
226226
main:4: error: Incompatible types in assignment (expression has type "str", variable has type "int")
@@ -233,7 +233,7 @@ m.x = ''
233233
[file m.py]
234234
x = 1
235235
[out]
236-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
236+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
237237
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
238238
main:2: error: Unsupported left operand type for + ("None")
239239
main:4: error: Incompatible types in assignment (expression has type "str", variable has type "int")
@@ -242,32 +242,32 @@ main:4: error: Incompatible types in assignment (expression has type "str", vari
242242
import nonexistent, another
243243
None + ''
244244
[out]
245-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
245+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
246246
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
247-
main:1: error: Cannot find implementation or library stub for module named 'another'
247+
main:1: error: Cannot find implementation or library stub for module named "another"
248248
main:2: error: Unsupported left operand type for + ("None")
249249

250250
[case testTypeCheckWithUnknownModule5]
251251
import nonexistent as x
252252
None + ''
253253
[out]
254-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
254+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
255255
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
256256
main:2: error: Unsupported left operand type for + ("None")
257257

258258
[case testTypeCheckWithUnknownModuleUsingFromImport]
259259
from nonexistent import x
260260
None + ''
261261
[out]
262-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
262+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
263263
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
264264
main:2: error: Unsupported left operand type for + ("None")
265265

266266
[case testTypeCheckWithUnknownModuleUsingImportStar]
267267
from nonexistent import *
268268
None + ''
269269
[out]
270-
main:1: error: Cannot find implementation or library stub for module named 'nonexistent'
270+
main:1: error: Cannot find implementation or library stub for module named "nonexistent"
271271
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
272272
main:2: error: Unsupported left operand type for + ("None")
273273

@@ -276,24 +276,24 @@ import xyz
276276
xyz.foo()
277277
xyz()
278278
[out]
279-
main:1: error: Cannot find implementation or library stub for module named 'xyz'
279+
main:1: error: Cannot find implementation or library stub for module named "xyz"
280280
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
281281

282282
[case testAccessingUnknownModule2]
283283
import xyz, bar
284284
xyz.foo()
285285
bar()
286286
[out]
287-
main:1: error: Cannot find implementation or library stub for module named 'xyz'
287+
main:1: error: Cannot find implementation or library stub for module named "xyz"
288288
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
289-
main:1: error: Cannot find implementation or library stub for module named 'bar'
289+
main:1: error: Cannot find implementation or library stub for module named "bar"
290290

291291
[case testAccessingUnknownModule3]
292292
import xyz as z
293293
xyz.foo()
294294
z()
295295
[out]
296-
main:1: error: Cannot find implementation or library stub for module named 'xyz'
296+
main:1: error: Cannot find implementation or library stub for module named "xyz"
297297
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
298298
main:2: error: Name 'xyz' is not defined
299299

@@ -302,14 +302,14 @@ from xyz import y, z
302302
y.foo()
303303
z()
304304
[out]
305-
main:1: error: Cannot find implementation or library stub for module named 'xyz'
305+
main:1: error: Cannot find implementation or library stub for module named "xyz"
306306
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
307307

308308
[case testAccessingNameImportedFromUnknownModule2]
309309
from xyz import *
310310
y
311311
[out]
312-
main:1: error: Cannot find implementation or library stub for module named 'xyz'
312+
main:1: error: Cannot find implementation or library stub for module named "xyz"
313313
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
314314
main:2: error: Name 'y' is not defined
315315

@@ -318,14 +318,14 @@ from xyz import y as z
318318
y
319319
z
320320
[out]
321-
main:1: error: Cannot find implementation or library stub for module named 'xyz'
321+
main:1: error: Cannot find implementation or library stub for module named "xyz"
322322
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
323323
main:2: error: Name 'y' is not defined
324324

325325
[case testUnknownModuleRedefinition]
326326
# Error messages differ with the new analyzer
327327

328-
import xab # E: Cannot find implementation or library stub for module named 'xab' # N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
328+
import xab # E: Cannot find implementation or library stub for module named "xab" # N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
329329
def xab(): pass # E: Name 'xab' already defined (possibly by an import)
330330

331331
[case testAccessingUnknownModuleFromOtherModule]
@@ -336,7 +336,7 @@ x.z
336336
import nonexistent
337337
[builtins fixtures/module.pyi]
338338
[out]
339-
tmp/x.py:1: error: Cannot find implementation or library stub for module named 'nonexistent'
339+
tmp/x.py:1: error: Cannot find implementation or library stub for module named "nonexistent"
340340
tmp/x.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
341341
main:3: error: Module has no attribute "z"
342342

@@ -346,7 +346,7 @@ def f():
346346
def foobar(): pass
347347
foobar('')
348348
[out]
349-
main:2: error: Cannot find implementation or library stub for module named 'foobar'
349+
main:2: error: Cannot find implementation or library stub for module named "foobar"
350350
main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
351351
main:4: error: Too many arguments for "foobar"
352352

@@ -356,7 +356,7 @@ def f():
356356
def x(): pass
357357
x('')
358358
[out]
359-
main:2: error: Cannot find implementation or library stub for module named 'foobar'
359+
main:2: error: Cannot find implementation or library stub for module named "foobar"
360360
main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
361361
main:4: error: Too many arguments for "x"
362362

@@ -2178,8 +2178,8 @@ import c
21782178

21792179
[out]
21802180
-- TODO: it would be better for this to be in the other order
2181-
tmp/b.py:1: error: Cannot find implementation or library stub for module named 'c'
2182-
main:1: error: Cannot find implementation or library stub for module named 'c'
2181+
tmp/b.py:1: error: Cannot find implementation or library stub for module named "c"
2182+
main:1: error: Cannot find implementation or library stub for module named "c"
21832183
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
21842184

21852185
[case testIndirectFromImportWithinCycle1]
@@ -2311,7 +2311,7 @@ from typing import Any
23112311
def __getattr__(attr: str) -> Any: ...
23122312
[builtins fixtures/module.pyi]
23132313
[out]
2314-
main:1: error: Cannot find implementation or library stub for module named 'a.b'
2314+
main:1: error: Cannot find implementation or library stub for module named "a.b"
23152315
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
23162316

23172317
[case testModuleGetattrInit4]
@@ -2356,12 +2356,12 @@ def __getattr__(attr: str) -> Any: ...
23562356
# empty (i.e. complete subpackage)
23572357
[builtins fixtures/module.pyi]
23582358
[out]
2359-
main:1: error: Cannot find implementation or library stub for module named 'a.b.c.d'
2359+
main:1: error: Cannot find implementation or library stub for module named "a.b.c.d"
23602360
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
2361-
main:1: error: Cannot find implementation or library stub for module named 'a.b.c'
2361+
main:1: error: Cannot find implementation or library stub for module named "a.b.c"
23622362

23632363
[case testModuleGetattrInit8a]
2364-
import a.b.c # E: Cannot find implementation or library stub for module named 'a.b.c' # N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
2364+
import a.b.c # E: Cannot find implementation or library stub for module named "a.b.c" # N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
23652365
import a.d # OK
23662366
[file a/__init__.pyi]
23672367
from typing import Any
@@ -2387,7 +2387,7 @@ def __getattr__(attr: str) -> Any: ...
23872387
ignore_missing_imports = True
23882388
[builtins fixtures/module.pyi]
23892389
[out]
2390-
main:3: error: Cannot find implementation or library stub for module named 'a.b.d'
2390+
main:3: error: Cannot find implementation or library stub for module named "a.b.d"
23912391
main:3: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
23922392

23932393
[case testIndirectFromImportWithinCycleUsedAsBaseClass]
@@ -2619,7 +2619,7 @@ from foo.bar import x
26192619
[file foo/bar.py]
26202620
x = 0
26212621
[out]
2622-
main:1: error: Cannot find implementation or library stub for module named 'foo.bar'
2622+
main:1: error: Cannot find implementation or library stub for module named "foo.bar"
26232623
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
26242624

26252625
[case testNamespacePackage]

test-data/unit/check-python2.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ main:8: error: Argument 2 to "f" has incompatible type "int"; expected "Tuple[in
167167
import asyncio
168168
import Bastion
169169
[out]
170-
main:1: error: Cannot find implementation or library stub for module named 'asyncio'
170+
main:1: error: Cannot find implementation or library stub for module named "asyncio"
171171
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
172172
main:2: error: No library stub file for standard library module 'Bastion'
173173
main:2: note: (Stub files are from https://github.com/python/typeshed)

test-data/unit/check-semanal-error.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ m.foo()
1818
m.x = m.y
1919
1() # E
2020
[out]
21-
main:1: error: Cannot find implementation or library stub for module named 'm'
21+
main:1: error: Cannot find implementation or library stub for module named "m"
2222
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
2323
main:4: error: "int" not callable
2424

@@ -28,7 +28,7 @@ x.foo()
2828
x.a = x.b
2929
1() # E
3030
[out]
31-
main:1: error: Cannot find implementation or library stub for module named 'm'
31+
main:1: error: Cannot find implementation or library stub for module named "m"
3232
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
3333
main:4: error: "int" not callable
3434

@@ -37,7 +37,7 @@ from m import * # E
3737
x # E
3838
1() # E
3939
[out]
40-
main:1: error: Cannot find implementation or library stub for module named 'm'
40+
main:1: error: Cannot find implementation or library stub for module named "m"
4141
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
4242
main:2: error: Name 'x' is not defined
4343
main:3: error: "int" not callable

test-data/unit/check-unreachable-code.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ else:
7878
import pow123 # E
7979
[builtins fixtures/bool.pyi]
8080
[out]
81-
main:6: error: Cannot find implementation or library stub for module named 'pow123'
81+
main:6: error: Cannot find implementation or library stub for module named "pow123"
8282
main:6: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
8383

8484
[case testMypyConditional]
@@ -98,7 +98,7 @@ else:
9898
import xyz753
9999
[typing fixtures/typing-medium.pyi]
100100
[out]
101-
main:3: error: Cannot find implementation or library stub for module named 'pow123'
101+
main:3: error: Cannot find implementation or library stub for module named "pow123"
102102
main:3: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
103103

104104
[case testTypeCheckingConditionalFromImport]
@@ -109,7 +109,7 @@ else:
109109
import xyz753
110110
[typing fixtures/typing-medium.pyi]
111111
[out]
112-
main:3: error: Cannot find implementation or library stub for module named 'pow123'
112+
main:3: error: Cannot find implementation or library stub for module named "pow123"
113113
main:3: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
114114

115115
[case testNegatedTypeCheckingConditional]
@@ -121,7 +121,7 @@ else:
121121
[builtins fixtures/bool.pyi]
122122
[typing fixtures/typing-medium.pyi]
123123
[out]
124-
main:5: error: Cannot find implementation or library stub for module named 'xyz753'
124+
main:5: error: Cannot find implementation or library stub for module named "xyz753"
125125
main:5: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
126126

127127
[case testUndefinedTypeCheckingConditional]
@@ -132,7 +132,7 @@ else:
132132
[builtins fixtures/bool.pyi]
133133
[out]
134134
main:1: error: Name 'TYPE_CHECKING' is not defined
135-
main:4: error: Cannot find implementation or library stub for module named 'xyz753'
135+
main:4: error: Cannot find implementation or library stub for module named "xyz753"
136136
main:4: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
137137

138138
[case testConditionalClassDefPY3]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy