Add --profile-test to run_profile.py
This commit is contained in:
parent
07d63e02c7
commit
ce4ad878aa
@ -50,6 +50,8 @@ def parse_args():
|
|||||||
help="The tool to use to view the profiling data")
|
help="The tool to use to view the profiling data")
|
||||||
parser.add_argument('--profile-file', metavar='FILE', action='store',
|
parser.add_argument('--profile-file', metavar='FILE', action='store',
|
||||||
help="The filename to use with --profile-tool=none")
|
help="The filename to use with --profile-tool=none")
|
||||||
|
parser.add_argument('--profile-test', action='store_true',
|
||||||
|
help="Run pytest instead of qutebrowser")
|
||||||
return parser.parse_known_args()
|
return parser.parse_known_args()
|
||||||
|
|
||||||
|
|
||||||
@ -65,6 +67,11 @@ def main():
|
|||||||
sys.argv = [sys.argv[0]] + remaining
|
sys.argv = [sys.argv[0]] + remaining
|
||||||
|
|
||||||
profiler = cProfile.Profile()
|
profiler = cProfile.Profile()
|
||||||
|
|
||||||
|
if args.profile_test:
|
||||||
|
import pytest
|
||||||
|
profiler.runcall(pytest.main)
|
||||||
|
else:
|
||||||
profiler.runcall(qutebrowser.qutebrowser.main)
|
profiler.runcall(qutebrowser.qutebrowser.main)
|
||||||
|
|
||||||
# If we have an exception after here, we don't want the qutebrowser
|
# If we have an exception after here, we don't want the qutebrowser
|
||||||
|
Loading…
Reference in New Issue
Block a user