From 51b7787b75b2a22f21f7b20c41a7dc343c13611a Mon Sep 17 00:00:00 2001 From: Alper Yoney Date: Mon, 21 Oct 2024 15:13:11 -0700 Subject: [PATCH] Enable pyre-strict for enum tests Summary: Enable pyre-struct and fix the type-errors. Reviewed By: ahilger, thedavekwon Differential Revision: D64668396 fbshipit-source-id: e068632505173212ac4d6b77b73bf0fa64cd26f4 --- thrift/test/thrift-python/enum_test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/thrift/test/thrift-python/enum_test.py b/thrift/test/thrift-python/enum_test.py index 534fb49d7cb..5da53b8d410 100644 --- a/thrift/test/thrift-python/enum_test.py +++ b/thrift/test/thrift-python/enum_test.py @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# pyre-strict + +import types import unittest import thrift.test.thrift_python.enum_test.thrift_mutable_types as mutable_types # @manual=//thrift/test/thrift-python:enum_test_thrift-python-types @@ -26,7 +29,7 @@ def setUp(self) -> None: self.maxDiff = None @parameterized.expand([immutable_types, mutable_types]) - def test_enum_default(self, test_types) -> None: + def test_enum_default(self, test_types: types.ModuleType) -> None: self.assertEqual(0, test_types.PositiveNumber.NONE) self.assertEqual(1, test_types.PositiveNumber.ONE) @@ -38,7 +41,7 @@ def test_enum_default(self, test_types) -> None: self.assertEqual([], s.color_list) @parameterized.expand([immutable_types, mutable_types]) - def test_enum_initialize(self, test_types) -> None: + def test_enum_initialize(self, test_types: types.ModuleType) -> None: s = test_types.TestStruct( number=test_types.PositiveNumber.TWO, number_list=[ @@ -58,7 +61,7 @@ def test_enum_initialize(self, test_types) -> None: self.assertEqual([test_types.Color.blue, test_types.Color.blue], s.color_list) @parameterized.expand([mutable_types]) - def test_enum_update(self, test_types) -> None: + def test_enum_update(self, test_types: types.ModuleType) -> None: s = test_types.TestStruct() self.assertEqual(test_types.PositiveNumber.NONE, s.number)