diff options
Diffstat (limited to 'test/option/profile.py')
-rw-r--r-- | test/option/profile.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/option/profile.py b/test/option/profile.py index eb6b394..7adf933 100644 --- a/test/option/profile.py +++ b/test/option/profile.py @@ -49,13 +49,13 @@ test.run(arguments = "--profile=%s -h" % scons_prof) test.fail_test(string.find(test.stdout(), 'usage: scons [OPTION]') == -1) test.fail_test(string.find(test.stdout(), 'usage: scons [OPTION]') == -1) -stats = pstats.Stats(scons_prof) -stats.sort_stats('time') - try: save_stdout = sys.stdout sys.stdout = StringIO.StringIO() + stats = pstats.Stats(scons_prof) + stats.sort_stats('time') + stats.strip_dirs().print_stats() s = sys.stdout.getvalue() @@ -63,9 +63,7 @@ finally: sys.stdout = save_stdout test.fail_test(string.find(s, 'Main.py') == -1) -test.fail_test(string.find(s, 'print_help') == -1) test.fail_test(string.find(s, '_main') == -1) -test.fail_test(string.find(s, 'option_parser.py') == -1) @@ -73,13 +71,13 @@ scons_prof = test.workpath('scons2.prof') test.run(arguments = "--profile %s" % scons_prof) -stats = pstats.Stats(scons_prof) -stats.sort_stats('time') - try: save_stdout = sys.stdout sys.stdout = StringIO.StringIO() + stats = pstats.Stats(scons_prof) + stats.sort_stats('time') + stats.strip_dirs().print_stats() s = sys.stdout.getvalue() |