Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67d35af

Browse files
authored
Fix test with unstable error order (#21301)
Fix random failure seen in https://github.com/python/mypy/actions/runs/24836654717/job/72698737347
1 parent c56ab58 commit 67d35af

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

test-data/unit/check-modules.test

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,11 @@ def xab(): pass # E: Name "xab" already defined (possibly by an import)
333333
[case testAccessingUnknownModuleFromOtherModule]
334334
import x
335335
x.nonexistent.foo
336-
x.z
336+
x.z # E: Module has no attribute "z"
337337
[file x.py]
338-
import nonexistent
338+
import nonexistent # E: Cannot find implementation or library stub for module named "nonexistent" \
339+
# N: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
339340
[builtins fixtures/module.pyi]
340-
[out]
341-
tmp/x.py:1: error: Cannot find implementation or library stub for module named "nonexistent"
342-
tmp/x.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
343-
main:3: error: Module has no attribute "z"
344341

345342
[case testUnknownModuleImportedWithinFunction]
346343
def f():

0 commit comments

Comments
 (0)