Fred Drake | bb7c144 | 2004-06-15 15:49:46 +0000 | [diff] [blame] | 1 | """Tests for distutils. |
| 2 | |
| 3 | The tests for distutils are defined in the distutils.tests package; |
| 4 | the test_suite() function there returns a test suite that's ready to |
| 5 | be run. |
| 6 | """ |
| 7 | |
Victor Stinner | 69ca32e | 2021-04-16 11:26:40 +0200 | [diff] [blame^] | 8 | import warnings |
| 9 | from test import support |
| 10 | from test.support import warnings_helper |
| 11 | |
| 12 | with warnings_helper.check_warnings( |
| 13 | ("The distutils package is deprecated", DeprecationWarning)): |
| 14 | |
| 15 | import distutils.tests |
Fred Drake | bb7c144 | 2004-06-15 15:49:46 +0000 | [diff] [blame] | 16 | |
| 17 | |
| 18 | def test_main(): |
Toshio Kuratomi | 997443c | 2020-01-27 04:08:39 -0800 | [diff] [blame] | 19 | # used by regrtest |
Victor Stinner | 69ca32e | 2021-04-16 11:26:40 +0200 | [diff] [blame^] | 20 | support.run_unittest(distutils.tests.test_suite()) |
| 21 | support.reap_children() |
Fred Drake | bb7c144 | 2004-06-15 15:49:46 +0000 | [diff] [blame] | 22 | |
| 23 | |
Toshio Kuratomi | 997443c | 2020-01-27 04:08:39 -0800 | [diff] [blame] | 24 | def load_tests(*_): |
| 25 | # used by unittest |
| 26 | return distutils.tests.test_suite() |
| 27 | |
| 28 | |
Fred Drake | bb7c144 | 2004-06-15 15:49:46 +0000 | [diff] [blame] | 29 | if __name__ == "__main__": |
| 30 | test_main() |