Skip to content

Commit

Permalink
Fix bad indent for class_schema_test.py
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 502696111
  • Loading branch information
daiyip authored and pyglove authors committed Jan 17, 2023
1 parent ce97fa9 commit 893b149
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions pyglove/core/typing/class_schema_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,22 +702,21 @@ def test_basics(self):
self.assertEqual(s['h'], Field('h', vs.Bool()))
self.assertEqual(s['i'], Field('i', vs.Str()))

def test_bad_cases(self):
with self.assertRaisesRegex(
TypeError, 'Metadata of schema should be a dict.'
):
class_schema.create_schema([], metadata=1)

with self.assertRaisesRegex(
TypeError, 'Field definition should be tuples with 2 to 4 elements.'
):
class_schema.create_schema(['a'])

def test_bad_cases(self):
with self.assertRaisesRegex(
TypeError, 'Metadata of schema should be a dict.'
):
class_schema.create_schema([], metadata=1)

with self.assertRaisesRegex(
TypeError, 'Field definition should be tuples with 2 to 4 elements.'
):
class_schema.create_schema(['a'])

with self.assertRaisesRegex(
TypeError, 'Field definition should be tuples with 2 to 4 elements.'
):
class_schema.create_schema([('a',)])
with self.assertRaisesRegex(
TypeError, 'Field definition should be tuples with 2 to 4 elements.'
):
class_schema.create_schema([('a',)])


if __name__ == '__main__':
Expand Down

0 comments on commit 893b149

Please sign in to comment.