devinabox: Properly clean up the 'build' directory from test runs.
brett.cannon pushed 921434ac1129 to devinabox: http://hg.python.org/devinabox/rev/921434ac1129 changeset: 31:921434ac1129 user: Brett Cannon <brett@python.org> date: Sat Feb 26 21:34:10 2011 -0800 summary: Properly clean up the 'build' directory from test runs. files: make_a_box.py run_all_tests.py diff --git a/make_a_box.py b/make_a_box.py --- a/make_a_box.py +++ b/make_a_box.py @@ -143,10 +143,12 @@ print('Running coverage ...') regrtest_path = os.path.join(CPython.directory, 'Lib', 'test', 'regrtest.py') - subprocess.check_call([executable, self.directory, 'run', '--pylib', - regrtest_path]) - # Clean up from the test run - os.rmdir('build') + try: + subprocess.check_call([executable, self.directory, 'run', '--pylib', + regrtest_path]) + finally: + # Clean up from the test run + os.rmdir('build') # Generate the HTML report print('Generating report ...') subprocess.call([executable, 'coveragepy', 'html', '-i', '--omit', diff --git a/run_all_tests.py b/run_all_tests.py --- a/run_all_tests.py +++ b/run_all_tests.py @@ -11,9 +11,12 @@ if cmd is None: print('CPython is not built') sys.exit(1) - subprocess.call([cmd, '-W', 'default', '-bb', '-E', '-m', 'test', '-r', - '-w', '-u', 'all', '-j', - str(multiprocessing.cpu_count())]) + try: + subprocess.call([cmd, '-W', 'default', '-bb', '-E', '-m', 'test', '-r', + '-w', '-u', 'all', '-j', + str(multiprocessing.cpu_count())]) + finally: + os.rmdir('build') if __name__ == '__main__': -- Repository URL: http://hg.python.org/devinabox
participants (1)
-
brett.cannon