blob: 678b9a8d98fef170e219dfec3388ced7ccaf3a40 [file] [log] [blame]
Guido van Rossum4114a4a2001-10-18 18:49:37 +00001# Test the frozen module defined in frozen.c.
Guido van Rossum4f72a782006-10-27 23:31:49 +00002# Currently test_frozen fails:
3# Implementing pep3102(keyword only argument) needs changes in
4# code object, which needs modification to marshal.
5# However, to regenerate hard-coded marshal data in frozen.c,
6# we need to run Tools/freeze/freeze.py, which currently doesn't work
7# because Lib/modulefinder.py cannot handle relative module import
8# This test will keep failing until Lib/modulefinder.py is fixed
Guido van Rossum4114a4a2001-10-18 18:49:37 +00009
Barry Warsaw408b6d32002-07-30 23:27:12 +000010from test.test_support import TestFailed
Guido van Rossum4114a4a2001-10-18 18:49:37 +000011import sys, os
12
13try:
14 import __hello__
Guido van Rossumb940e112007-01-10 16:19:56 +000015except ImportError as x:
Finn Bock218c5f92002-11-01 11:33:00 +000016 raise TestFailed, "import __hello__ failed:" + str(x)
Guido van Rossum4114a4a2001-10-18 18:49:37 +000017
18try:
19 import __phello__
Guido van Rossumb940e112007-01-10 16:19:56 +000020except ImportError as x:
Finn Bock218c5f92002-11-01 11:33:00 +000021 raise TestFailed, "import __phello__ failed:" + str(x)
Guido van Rossum4114a4a2001-10-18 18:49:37 +000022
23try:
24 import __phello__.spam
Guido van Rossumb940e112007-01-10 16:19:56 +000025except ImportError as x:
Finn Bock218c5f92002-11-01 11:33:00 +000026 raise TestFailed, "import __phello__.spam failed:" + str(x)
Guido van Rossum4114a4a2001-10-18 18:49:37 +000027
Jack Jansen2918ae82003-01-08 16:30:54 +000028if sys.platform != "mac": # On the Mac this import does succeed.
29 try:
30 import __phello__.foo
31 except ImportError:
32 pass
33 else:
34 raise TestFailed, "import __phello__.foo should have failed"