Brett Cannon | 5e129db | 2009-08-27 23:52:35 +0000 | [diff] [blame] | 1 | """Run Python's standard test suite using importlib.__import__. |
| 2 | |
Brett Cannon | 12c3fc9 | 2009-08-30 08:39:57 +0000 | [diff] [blame] | 3 | Tests known to fail because of assumptions that importlib (properly) |
| 4 | invalidates are automatically skipped if the entire test suite is run. |
| 5 | Otherwise all command-line options valid for test.regrtest are also valid for |
| 6 | this script. |
| 7 | |
Brett Cannon | 5e129db | 2009-08-27 23:52:35 +0000 | [diff] [blame] | 8 | XXX FAILING |
Brett Cannon | 5e129db | 2009-08-27 23:52:35 +0000 | [diff] [blame] | 9 | test_import # execution bit, exception name differing, file name differing |
| 10 | between code and module (?) |
Brett Cannon | 5e129db | 2009-08-27 23:52:35 +0000 | [diff] [blame] | 11 | |
| 12 | """ |
| 13 | import importlib |
| 14 | import sys |
| 15 | from test import regrtest |
| 16 | |
| 17 | if __name__ == '__main__': |
| 18 | __builtins__.__import__ = importlib.__import__ |
| 19 | |
| 20 | exclude = ['--exclude', |
| 21 | 'test_frozen', # Does not expect __loader__ attribute |
| 22 | 'test_pkg', # Does not expect __loader__ attribute |
| 23 | 'test_pydoc', # Does not expect __loader__ attribute |
| 24 | ] |
Brett Cannon | 5e129db | 2009-08-27 23:52:35 +0000 | [diff] [blame] | 25 | |
Brett Cannon | 6cc8310 | 2009-08-30 08:30:35 +0000 | [diff] [blame] | 26 | # Switching on --exclude implies running all test but the ones listed, so |
| 27 | # only use it when one is not running an explicit test |
| 28 | if len(sys.argv) == 1: |
| 29 | # No programmatic way to specify tests to exclude |
| 30 | sys.argv.extend(exclude) |
| 31 | |
Brett Cannon | ce7d4cb | 2009-08-30 19:44:32 +0000 | [diff] [blame] | 32 | regrtest.main(quiet=True, verbose2=True) |