diff --git a/tests/test_error.py b/tests/test_error.py index 44f7797..d2d982c 100644 --- a/tests/test_error.py +++ b/tests/test_error.py @@ -31,3 +31,7 @@ def test_invalid_char_quotes(): with pytest.raises(tomli.TOMLDecodeError) as exc_info: tomli.loads("v = '\n'") assert " '\\n' " in str(exc_info.value) + + +def test_module_name(): + assert tomli.TOMLDecodeError().__module__ == "tomli" diff --git a/tomli/__init__.py b/tomli/__init__.py index d99eadc..7061912 100644 --- a/tomli/__init__.py +++ b/tomli/__init__.py @@ -4,3 +4,6 @@ __version__ = "1.2.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT from tomli._parser import TOMLDecodeError, load, loads + +# Pretend this exception was created here. +TOMLDecodeError.__module__ = "tomli"