Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 955447b

Browse files
authored
pylint all Python scripts under testing/ (#38268)
1 parent aa78cd8 commit 955447b

File tree

5 files changed

+137
-137
lines changed

5 files changed

+137
-137
lines changed

ci/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ pylint-2.7 --rcfile=.pylintrc \
7575
"ci/" \
7676
"impeller/" \
7777
"tools/gn" \
78-
"testing/run_tests.py"
78+
"testing/"
7979

8080
echo "$(date +%T) Linting complete"

testing/android_systrace_test.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
PERFETTO_SESSION_KEY = 'session1'
1717
PERFETTO_TRACE_FILE = '/data/misc/perfetto-traces/trace'
18-
PERFETTO_CONFIG = '''
18+
PERFETTO_CONFIG = """
1919
write_into_file: true
2020
file_write_period_ms: 1000000000
2121
flush_period_ms: 1000
@@ -32,10 +32,10 @@
3232
}
3333
}
3434
}
35-
'''
35+
"""
3636

3737

38-
def InstallApk(apk_path, package_name, adb_path='adb'):
38+
def install_apk(apk_path, package_name, adb_path='adb'):
3939
print('Installing APK')
4040
subprocess.check_output([adb_path, 'shell', 'am', 'force-stop', package_name])
4141
# Allowed to fail if APK was never installed.
@@ -44,7 +44,7 @@ def InstallApk(apk_path, package_name, adb_path='adb'):
4444
subprocess.check_output([adb_path, 'install', apk_path])
4545

4646

47-
def StartPerfetto(package_name, adb_path='adb'):
47+
def start_perfetto(package_name, adb_path='adb'):
4848
print('Starting trace')
4949
cmd = [
5050
adb_path, 'shell', 'echo', "'" + PERFETTO_CONFIG % package_name + "'",
@@ -55,7 +55,7 @@ def StartPerfetto(package_name, adb_path='adb'):
5555
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
5656

5757

58-
def LaunchPackage(package_name, activity_name, adb_path='adb'):
58+
def launch_package(package_name, activity_name, adb_path='adb'):
5959
print('Scanning logcat')
6060
subprocess.check_output([adb_path, 'logcat', '-c'], stderr=subprocess.STDOUT)
6161
logcat = subprocess.Popen([adb_path, 'logcat'],
@@ -77,7 +77,7 @@ def LaunchPackage(package_name, activity_name, adb_path='adb'):
7777
break
7878

7979

80-
def CollectAndValidateTrace(adb_path='adb'):
80+
def collect_and_validate_trace(adb_path='adb'):
8181
print('Fetching trace')
8282
subprocess.check_output([
8383
adb_path, 'shell', 'perfetto', '--attach', PERFETTO_SESSION_KEY, '--stop'
@@ -140,10 +140,10 @@ def main():
140140

141141
args = parser.parse_args()
142142

143-
InstallApk(args.apk_path, args.package_name, args.adb_path)
144-
StartPerfetto(args.package_name, args.adb_path)
145-
LaunchPackage(args.package_name, args.activity_name, args.adb_path)
146-
return CollectAndValidateTrace(args.adb_path)
143+
install_apk(args.apk_path, args.package_name, args.adb_path)
144+
start_perfetto(args.package_name, args.adb_path)
145+
launch_package(args.package_name, args.activity_name, args.adb_path)
146+
return collect_and_validate_trace(args.adb_path)
147147

148148

149149
if __name__ == '__main__':

0 commit comments

Comments
 (0)