cpython/Lib/test/test_frozen.py
Guido van Rossum 4114a4afec Fix the frozen bytecode for __hello__ (betcha didn't know that existed
:-).

Add a test that prevents the __hello__ bytecode from going stale
unnoticed again.

The test also tests the loophole noted in SF bug #404545.  This test
will fail right now; I'll check in the fix in a minute.
2001-10-18 18:49:37 +00:00

26 lines
550 B
Python

# Test the frozen module defined in frozen.c.
from test_support import TestFailed
import sys, os
try:
import __hello__
except ImportError, x:
raise TestFailed, "import __hello__ failed:", x
try:
import __phello__
except ImportError, x:
raise TestFailed, "import __phello__ failed:", x
try:
import __phello__.spam
except ImportError, x:
raise TestFailed, "import __phello__.spam failed:", x
try:
import __phello__.foo
except ImportError:
pass
else:
raise TestFailed, "import __phello__.foo should have failed"