Skip to content

use different stubs in test #3044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mypy/moduleinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -422,6 +425,9 @@
'xml.sax.xmlreader',
'zipfile',
'zlib',
# fake names to use in tests
'__dummy_stdlib1',
'__dummy_stdlib2',
}

# Python 2 standard library modules.
Expand Down
16 changes: 8 additions & 8 deletions test-data/unit/semanal-errors.test
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down