Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 1 | # Test the frozen module defined in frozen.c. |
Guido van Rossum | 4f72a78 | 2006-10-27 23:31:49 +0000 | [diff] [blame] | 2 | # 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 Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 9 | |
Barry Warsaw | 408b6d3 | 2002-07-30 23:27:12 +0000 | [diff] [blame] | 10 | from test.test_support import TestFailed |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 11 | import sys, os |
| 12 | |
Martin v. Löwis | 5b22213 | 2007-06-10 09:51:05 +0000 | [diff] [blame^] | 13 | raise TestFailed, "test currently causes assertion in debug mode" |
| 14 | |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 15 | try: |
| 16 | import __hello__ |
Guido van Rossum | b940e11 | 2007-01-10 16:19:56 +0000 | [diff] [blame] | 17 | except ImportError as x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame] | 18 | raise TestFailed, "import __hello__ failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 19 | |
| 20 | try: |
| 21 | import __phello__ |
Guido van Rossum | b940e11 | 2007-01-10 16:19:56 +0000 | [diff] [blame] | 22 | except ImportError as x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame] | 23 | raise TestFailed, "import __phello__ failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 24 | |
| 25 | try: |
| 26 | import __phello__.spam |
Guido van Rossum | b940e11 | 2007-01-10 16:19:56 +0000 | [diff] [blame] | 27 | except ImportError as x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame] | 28 | raise TestFailed, "import __phello__.spam failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 29 | |
Jack Jansen | 2918ae8 | 2003-01-08 16:30:54 +0000 | [diff] [blame] | 30 | if sys.platform != "mac": # On the Mac this import does succeed. |
| 31 | try: |
| 32 | import __phello__.foo |
| 33 | except ImportError: |
| 34 | pass |
| 35 | else: |
| 36 | raise TestFailed, "import __phello__.foo should have failed" |