HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/scipy/_lib/tests/test_import_cycles.py
import sys
import subprocess

from .test_public_api import PUBLIC_MODULES

# Regression tests for gh-6793.
# Check that all modules are importable in a new Python process.
# This is not necessarily true if there are import cycles present.

def test_public_modules_importable():
    pids = [subprocess.Popen([sys.executable, '-c', f'import {module}'])
            for module in PUBLIC_MODULES]
    for i, pid in enumerate(pids):
        assert pid.wait() == 0, f'Failed to import {PUBLIC_MODULES[i]}'