Skip to content

Commit 5434979

Browse files
JelleZijlstragvanrossum
authored andcommitted
use different stubs in test (#3044)
Use dedicated dummy names instead of other real modules.
1 parent a7e18eb commit 5434979

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

mypy/moduleinfo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@
225225
'PyQt4',
226226
'PyQt5',
227227
'pylons',
228+
229+
# for use in tests
230+
'__dummy_third_party1',
228231
}
229232

230233
# Modules and packages common to Python 2.7 and 3.x.
@@ -422,6 +425,9 @@
422425
'xml.sax.xmlreader',
423426
'zipfile',
424427
'zlib',
428+
# fake names to use in tests
429+
'__dummy_stdlib1',
430+
'__dummy_stdlib2',
425431
}
426432

427433
# Python 2 standard library modules.

test-data/unit/semanal-errors.test

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,24 +1289,24 @@ y = 1
12891289
[out]
12901290

12911291
[case testMissingStubForThirdPartyModule]
1292-
import nosexcover
1292+
import __dummy_third_party1
12931293
[out]
1294-
main:1: error: No library stub file for module 'nosexcover'
1294+
main:1: error: No library stub file for module '__dummy_third_party1'
12951295
main:1: note: (Stub files are from https://github.com/python/typeshed)
12961296

12971297
[case testMissingStubForStdLibModule]
1298-
import tabnanny
1298+
import __dummy_stdlib1
12991299
[out]
1300-
main:1: error: No library stub file for standard library module 'tabnanny'
1300+
main:1: error: No library stub file for standard library module '__dummy_stdlib1'
13011301
main:1: note: (Stub files are from https://github.com/python/typeshed)
13021302

13031303
[case testMissingStubForTwoModules]
1304-
import tabnanny
1305-
import xdrlib
1304+
import __dummy_stdlib1
1305+
import __dummy_stdlib2
13061306
[out]
1307-
main:1: error: No library stub file for standard library module 'tabnanny'
1307+
main:1: error: No library stub file for standard library module '__dummy_stdlib1'
13081308
main:1: note: (Stub files are from https://github.com/python/typeshed)
1309-
main:2: error: No library stub file for standard library module 'xdrlib'
1309+
main:2: error: No library stub file for standard library module '__dummy_stdlib2'
13101310

13111311
[case testListComprehensionSpecialScoping]
13121312
class A:

0 commit comments

Comments
 (0)