File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ def test_minify():
7474
7575
7676def test_exceptions ():
77- with pytest .raises (KeyError , match = "Unknown option 'non_existent_option'" ):
77+ with pytest .raises (AttributeError , match = "Unknown option 'non_existent_option'" ):
7878 _ = FracturedJsonOptions (non_existent_option = True )
7979
8080 with pytest .raises (
@@ -110,6 +110,19 @@ def test_exceptions():
110110 with pytest .raises (TypeError , match = "Must be callable" ):
111111 formatter .string_length_func = 123 # type: ignore[assignment]
112112
113+ options = FracturedJsonOptions ()
114+ with pytest .raises (
115+ AttributeError ,
116+ match = "FracturedJsonOptions has no attribute 'invalid'" ,
117+ ):
118+ _ = options .invalid
119+
120+ with pytest .raises (
121+ AttributeError ,
122+ match = "FracturedJsonOptions has no attribute 'invalid'" ,
123+ ):
124+ options .invalid = 0
125+
113126
114127def test_dll_missing (path_is_file_fails ): # noqa: ARG001
115128 if "fractured_json" in sys .modules :
You can’t perform that action at this time.
0 commit comments