Skip to content

Commit

Permalink
Test AttributeError -> TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
hukkin committed Sep 25, 2024
1 parent a75b09f commit 372f192
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def test_type_error(self):
tomllib.loads(b"v = 1") # type: ignore[arg-type]
self.assertEqual(str(exc_info.exception), "Expected str object, not 'bytes'")

with self.assertRaises(TypeError) as exc_info:
tomllib.loads(False) # type: ignore[arg-type]
self.assertEqual(str(exc_info.exception), "Expected str object, not 'bool'")

def test_module_name(self):
self.assertEqual(tomllib.TOMLDecodeError().__module__, tomllib.__name__)

Expand Down

0 comments on commit 372f192

Please sign in to comment.