Skip to content

Commit ebfaf4f

Browse files
p3rf Teamcopybara-github
authored andcommitted
resolve unsoundness caused by pytype.
PiperOrigin-RevId: 842351622
1 parent de40487 commit ebfaf4f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

tests/providers/aws/aws_dynamodb_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ def GetTestDynamoDBInstance(minimal=False):
8181
yaml_string=spec, benchmark_name='aws_dynamodb_ycsb'
8282
)
8383
test_benchmark_spec.ConstructNonRelationalDb()
84-
return test_benchmark_spec.non_relational_db
84+
instance = test_benchmark_spec.non_relational_db
85+
if instance is None:
86+
raise ValueError(
87+
'BenchmarkSpec.ConstructNonRelationalDb() failed to create a '
88+
'non_relational_db instance for testing, tests cannot proceed.'
89+
)
90+
return instance
8591

8692

8793
class AwsDynamodbTest(pkb_common_test_case.PkbCommonTestCase):

tests/providers/gcp/gcp_bigtable_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,17 @@ def GetTestBigtableInstance(spec=_TEST_BENCHMARK_SPEC):
107107
yaml_string=spec, benchmark_name='cloud_bigtable_ycsb'
108108
)
109109
test_benchmark_spec.ConstructNonRelationalDb()
110-
return test_benchmark_spec.non_relational_db
110+
instance = test_benchmark_spec.non_relational_db
111+
if instance is None:
112+
raise ValueError(
113+
'BenchmarkSpec.ConstructNonRelationalDb() failed to create a '
114+
'non_relational_db instance for testing, tests cannot proceed.'
115+
)
116+
return instance
111117

112118

113119
class GcpBigtableTestCase(pkb_common_test_case.PkbCommonTestCase):
120+
bigtable: gcp_bigtable.GcpBigtableInstance
114121

115122
def setUp(self):
116123
super().setUp()

tests/scripts/messaging_service_scripts_e2e_workers_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class BaseSubprocessTest(pkb_common_test_case.PkbCommonTestCase):
6262

6363
@classmethod
6464
def Main(cls, *args, **kwargs):
65-
cls.main_function(*args, **kwargs) # pylint: disable=not-callable
65+
cls.main_function(*args, **kwargs) # pylint: disable=not-callable # pytype: disable=not-callable
6666

6767
def setUp(self):
6868
super().setUp()

0 commit comments

Comments
 (0)