diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bb5509..d7b9927 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,6 +32,12 @@ jobs: pip install --upgrade pip setuptools pip install .[testing] + - name: Run pytype + if: matrix.python-version != '3.13' + run: | + rm -f android_env/proto/*_pb2.py android_env/proto/a11y/*_pb2.py android_env/proto/*_pb2_grpc.py + pytype android_env + - name: Run tests run: | # Find all test files, print their names and execute them in parallel diff --git a/android_env/components/simulators/fake/fake_simulator_test.py b/android_env/components/simulators/fake/fake_simulator_test.py index 15d8640..6f2e53e 100644 --- a/android_env/components/simulators/fake/fake_simulator_test.py +++ b/android_env/components/simulators/fake/fake_simulator_test.py @@ -79,6 +79,7 @@ def test_adb_output(self): line = line.decode('utf-8') matches = re.match(r'\s+SurfaceOrientation:\s+(\d)', line) self.assertIsNotNone(matches) + assert matches is not None orientation = matches.group(1) self.assertEqual(orientation, '0') line = adb_controller.execute_command(['shell', 'service', 'check', 'foo']) diff --git a/android_env/components/task_manager_test.py b/android_env/components/task_manager_test.py index e53e5dd..5a9b0fb 100644 --- a/android_env/components/task_manager_test.py +++ b/android_env/components/task_manager_test.py @@ -62,6 +62,7 @@ def _assert_match(self, event: re.Pattern[str], text: str) -> re.Match[str]: self.assertRegex(text, event) match = event.fullmatch(text) self.assertIsNotNone(match) + assert match is not None return match def test_start(self):