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

Method test_disabled_error

Lib/test/test_configparser.py:2229–2237  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2227 self.assertEqual(output.getvalue(), 'a = 1\n\n')
2228
2229 def test_disabled_error(self):
2230 with self.assertRaises(configparser.MissingSectionHeaderError):
2231 configparser.ConfigParser().read_string("a = 1")
2232
2233 with self.assertRaises(configparser.UnnamedSectionDisabledError):
2234 configparser.ConfigParser().add_section(configparser.UNNAMED_SECTION)
2235
2236 with self.assertRaises(configparser.UnnamedSectionDisabledError):
2237 configparser.ConfigParser()[configparser.UNNAMED_SECTION] = {'a': '1'}
2238
2239 def test_multiple_configs(self):
2240 cfg = configparser.ConfigParser(allow_unnamed_section=True)

Callers

nothing calls this directly

Calls 3

read_stringMethod · 0.80
assertRaisesMethod · 0.45
add_sectionMethod · 0.45

Tested by

no test coverage detected