Brett Cannon | 5e129db | 2009-08-27 23:52:35 +0000 | [diff] [blame^] | 1 | """Run Python's standard test suite using importlib.__import__. |
| 2 | |
| 3 | XXX FAILING |
| 4 | test___all__ # tuple being given for fromlist (looks like interpreter is |
| 5 | doing it) |
| 6 | test_builtin # Wanting a TypeError for an integer name |
| 7 | test_import # execution bit, exception name differing, file name differing |
| 8 | between code and module (?) |
| 9 | test_importhooks # package not set in _gcd_import() but level > 0 |
| 10 | test_pep3120 # Difference in exception |
| 11 | test_runpy # Importing sys.imp.eric raises AttributeError instead of |
| 12 | ImportError (as does any attempt to import a sub-module |
| 13 | from a non-package, e.g. tokenize.menotreal) |
| 14 | |
| 15 | """ |
| 16 | import importlib |
| 17 | import sys |
| 18 | from test import regrtest |
| 19 | |
| 20 | if __name__ == '__main__': |
| 21 | __builtins__.__import__ = importlib.__import__ |
| 22 | |
| 23 | exclude = ['--exclude', |
| 24 | 'test_frozen', # Does not expect __loader__ attribute |
| 25 | 'test_pkg', # Does not expect __loader__ attribute |
| 26 | 'test_pydoc', # Does not expect __loader__ attribute |
| 27 | ] |
| 28 | # No programmatic way to specify tests to exclude |
| 29 | sys.argv.extend(exclude) |
| 30 | |
| 31 | # verbose=True, quiet=False for all failure info |
| 32 | # tests=[...] for specific tests to run |
| 33 | regrtest.main(quiet=True) |