diff --git a/mypy/moduleinfo.py b/mypy/moduleinfo.py index 6deca6ff0423..ec6a8fdfde23 100644 --- a/mypy/moduleinfo.py +++ b/mypy/moduleinfo.py @@ -225,6 +225,9 @@ 'PyQt4', 'PyQt5', 'pylons', + + # for use in tests + '__dummy_third_party1', } # Modules and packages common to Python 2.7 and 3.x. @@ -422,6 +425,9 @@ 'xml.sax.xmlreader', 'zipfile', 'zlib', + # fake names to use in tests + '__dummy_stdlib1', + '__dummy_stdlib2', } # Python 2 standard library modules. diff --git a/test-data/unit/semanal-errors.test b/test-data/unit/semanal-errors.test index aa3778a26d75..2b8d8fe0fe9f 100644 --- a/test-data/unit/semanal-errors.test +++ b/test-data/unit/semanal-errors.test @@ -1289,24 +1289,24 @@ y = 1 [out] [case testMissingStubForThirdPartyModule] -import nosexcover +import __dummy_third_party1 [out] -main:1: error: No library stub file for module 'nosexcover' +main:1: error: No library stub file for module '__dummy_third_party1' main:1: note: (Stub files are from https://github.com/python/typeshed) [case testMissingStubForStdLibModule] -import tabnanny +import __dummy_stdlib1 [out] -main:1: error: No library stub file for standard library module 'tabnanny' +main:1: error: No library stub file for standard library module '__dummy_stdlib1' main:1: note: (Stub files are from https://github.com/python/typeshed) [case testMissingStubForTwoModules] -import tabnanny -import xdrlib +import __dummy_stdlib1 +import __dummy_stdlib2 [out] -main:1: error: No library stub file for standard library module 'tabnanny' +main:1: error: No library stub file for standard library module '__dummy_stdlib1' main:1: note: (Stub files are from https://github.com/python/typeshed) -main:2: error: No library stub file for standard library module 'xdrlib' +main:2: error: No library stub file for standard library module '__dummy_stdlib2' [case testListComprehensionSpecialScoping] class A: