MCPcopy Index your code
hub / github.com/python/cpython / test_incorrect_load

Method test_incorrect_load

Lib/test/test_tomllib/test_misc.py:30–38  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 self.assertEqual(actual, expected)
29
30 def test_incorrect_load(self):
31 content = "one=1"
32 with tempfile.TemporaryDirectory() as tmp_dir_path:
33 file_path = Path(tmp_dir_path) / "test.toml"
34 file_path.write_text(content)
35
36 with open(file_path, "r") as txt_f:
37 with self.assertRaises(TypeError):
38 tomllib.load(txt_f) # type: ignore[arg-type]
39
40 def test_parse_float(self):
41 doc = """

Callers

nothing calls this directly

Calls 5

PathClass · 0.90
openFunction · 0.50
write_textMethod · 0.45
assertRaisesMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected