Lines Matching refs:configparser
2 import configparser
43 dict_type = configparser._default_dict
45 default_section = configparser.DEFAULTSECT
46 interpolation = configparser._UNSET
141 with self.assertRaises(configparser.NoSectionError):
143 with self.assertRaises(configparser.NoOptionError):
152 with self.assertRaises(configparser.NoOptionError):
159 with self.assertRaises(configparser.NoOptionError):
165 with self.assertRaises(configparser.NoOptionError):
265 with self.assertRaises(configparser.NoSectionError) as cm:
336 with self.assertRaises(configparser.DuplicateOptionError):
342 with self.assertRaises(configparser.DuplicateSectionError):
415 with self.assertRaises(configparser.DuplicateSectionError):
420 with self.assertRaises(configparser.DuplicateOptionError):
452 with self.assertRaises(configparser.NoSectionError):
533 self.parse_error(cf, configparser.ParsingError,
536 self.parse_error(cf, configparser.ParsingError,
539 e = self.parse_error(cf, configparser.MissingSectionHeaderError,
543 e = self.parse_error(cf, configparser.ParsingError,
549 error = configparser.ParsingError
552 error = configparser.MissingSectionHeaderError
575 with self.assertRaises(configparser.NoSectionError):
577 with self.assertRaises(configparser.NoSectionError):
579 e = self.get_error(cf, configparser.NoSectionError, "foo", "bar")
582 e = self.get_error(cf, configparser.NoOptionError, "foo", "bar")
622 with self.assertRaises(configparser.DuplicateSectionError) as cm:
629 with self.assertRaises(configparser.DuplicateSectionError) as cm:
643 with self.assertRaises(configparser.DuplicateOptionError) as cm:
806 with self.assertRaises(configparser.NoSectionError):
884 with self.assertRaises(configparser.ParsingError):
891 config_class = configparser.RawConfigParser
896 config_class = configparser.ConfigParser
906 e = self.get_error(cf, configparser.InterpolationDepthError, "Foo", "bar11")
907 if self.interpolation == configparser._UNSET:
910 elif isinstance(self.interpolation, configparser.LegacyInterpolation):
916 e = self.get_error(cf, configparser.InterpolationMissingOptionError,
921 if self.interpolation == configparser._UNSET:
924 elif isinstance(self.interpolation, configparser.LegacyInterpolation):
943 if self.interpolation == configparser._UNSET:
945 elif isinstance(self.interpolation, configparser.LegacyInterpolation):
994 config_class = configparser.ConfigParser
1021 class CustomConfigParser(configparser.ConfigParser):
1030 config_class = configparser.ConfigParser
1033 interpolation = configparser.LegacyInterpolation()
1055 for value in [configparser.ExtendedInterpolation, 42, "a string"]:
1058 configparser.ConfigParser(interpolation=value)
1072 config_class = configparser.ConfigParser
1101 config_class = configparser.RawConfigParser
1134 if cf._dict is configparser._default_dict:
1158 config_class = configparser.RawConfigParser
1178 config_class = configparser.ConfigParser
1179 interpolation = configparser.ExtendedInterpolation()
1247 with self.assertRaises(configparser.InterpolationDepthError):
1249 with self.assertRaises(configparser.InterpolationDepthError):
1267 exception_class = configparser.InterpolationMissingOptionError
1311 with self.assertRaises(configparser.DuplicateOptionError):
1334 with self.assertRaises(configparser.InterpolationSyntaxError):
1336 with self.assertRaises(configparser.InterpolationMissingOptionError):
1338 with self.assertRaises(configparser.InterpolationMissingOptionError):
1340 with self.assertRaises(configparser.InterpolationSyntaxError):
1342 with self.assertRaises(configparser.InterpolationSyntaxError):
1353 config_class = configparser.ConfigParser
1383 with self.assertRaises(configparser.InterpolationMissingOptionError):
1416 cp = configparser.ConfigParser(allow_no_value=False)
1422 output = self.prepare(configparser.RawConfigParser)
1450 config_class = configparser.RawConfigParser
1472 config_class = configparser.ConfigParser
1504 """As advised in Doc/library/configparser.rst."""
1519 parser = configparser.ConfigParser()
1530 parser = configparser.ConfigParser()
1538 parser = configparser.ConfigParser()
1551 parser = configparser.ConfigParser()
1552 with self.assertRaises(configparser.DuplicateSectionError) as dse:
1563 parser = configparser.ConfigParser()
1564 with self.assertRaises(configparser.DuplicateOptionError) as dse:
1574 parser = configparser.ConfigParser()
1575 with self.assertRaises(configparser.ParsingError) as dse:
1584 parser = configparser.ConfigParser()
1585 with self.assertRaises(configparser.MissingSectionHeaderError) as dse:
1598 error = configparser.DuplicateOptionError('section', 'option')
1608 error = configparser.InterpolationDepthError('option', 'section',
1616 configparser.ParsingError()
1620 configparser.ParsingError(source='source', filename='filename')
1623 error = configparser.ParsingError(filename='source')
1634 parser = configparser.ConfigParser()
1641 with self.assertRaises(configparser.InterpolationSyntaxError) as cm:
1645 with self.assertRaises(configparser.InterpolationSyntaxError) as cm:
1655 parser = configparser.ConfigParser()
1667 parser = configparser.SafeConfigParser()
1674 configparser.LegacyInterpolation()
1680 parser = configparser.ConfigParser()
1688 parser = configparser.ConfigParser()
1721 e1 = configparser.Error('value')
1730 e1 = configparser.NoSectionError('section')
1741 e1 = configparser.NoOptionError('option', 'section')
1753 e1 = configparser.DuplicateSectionError('section', 'source', 123)
1766 e1 = configparser.DuplicateOptionError('section', 'option', 'source',
1781 e1 = configparser.InterpolationError('option', 'section', 'msg')
1793 e1 = configparser.InterpolationMissingOptionError('option', 'section',
1807 e1 = configparser.InterpolationSyntaxError('option', 'section', 'msg')
1819 e1 = configparser.InterpolationDepthError('option', 'section',
1832 e1 = configparser.ParsingError('source')
1844 e1 = configparser.ParsingError(filename='filename')
1859 e1 = configparser.MissingSectionHeaderError('filename', 123, 'line')
1876 cfg = configparser.ConfigParser(inline_comment_prefixes=(';', '#',
1912 parser = configparser.ConfigParser()
1919 cm = self.assertRaises(configparser.InterpolationMissingOptionError)
1925 parser = configparser.ConfigParser(
1926 interpolation=configparser.ExtendedInterpolation())
1933 cm = self.assertRaises(configparser.InterpolationMissingOptionError)
1939 parser = configparser.ConfigParser()
1944 with self.assertRaises(configparser.NoSectionError) as cm:
1949 config = configparser.ConfigParser()
1950 with self.assertRaises(configparser.NoSectionError) as cm:
1955 config = configparser.ConfigParser()
1956 with self.assertRaises(configparser.NoSectionError) as cm:
1964 config_class = configparser.ConfigParser
2060 cfg = configparser.ConfigParser(converters={'len': len})
2066 class StrangeConfigParser(configparser.ConfigParser):
2070 fallback=configparser._UNSET):
2076 fallback=configparser._UNSET):
2109 with self.assertRaises(configparser.NoOptionError):
2121 cfg = configparser.ConfigParser()
2156 support.check__all__(self, configparser, not_exported={"Error"})