| 1 |
import sys |
| 2 |
import importlib |
| 3 |
import pytest |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
expected_modules = [] |
| 16 |
|
| 17 |
|
| 18 |
expected_modules += [ |
| 19 |
'_opcode', |
| 20 |
'asyncio', |
| 21 |
'bz2', |
| 22 |
'code', |
| 23 |
'ctypes.test', |
| 24 |
'gzip', |
| 25 |
'_hashlib', |
| 26 |
'lzma', |
| 27 |
'mmap', |
| 28 |
'_multiprocessing', |
| 29 |
'multiprocessing.synchronize', |
| 30 |
'select', |
| 31 |
'_sqlite3', |
| 32 |
'ssl', |
| 33 |
'_thread', |
| 34 |
'threading', |
| 35 |
'zlib', |
| 36 |
] |
| 37 |
|
| 38 |
|
| 39 |
if sys.platform != 'win32': |
| 40 |
expected_modules += [ |
| 41 |
'curses', |
| 42 |
'curses.ascii', |
| 43 |
'curses.textpad', |
| 44 |
'dbm', |
| 45 |
'dbm.gnu', |
| 46 |
'fcntl', |
| 47 |
'grp', |
| 48 |
'posix', |
| 49 |
'pty', |
| 50 |
'pwd', |
| 51 |
'resource', |
| 52 |
'syslog', |
| 53 |
'termios', |
| 54 |
] |
| 55 |
else: |
| 56 |
|
| 57 |
expected_modules += [ |
| 58 |
'winreg', |
| 59 |
] |
| 60 |
|
| 61 |
|
| 62 |
if sys.platform.startswith('linux'): |
| 63 |
expected_modules += [ |
| 64 |
'crypt', |
| 65 |
] |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
@pytest.fixture(scope="module", params=expected_modules) |
| 71 |
def modname(request): |
| 72 |
return request.param |
| 73 |
|
| 74 |
def test_expected_modules(modname): |
| 75 |
importlib.import_module(modname) |