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

Method test_defaults_keyword

Lib/test/test_configparser.py:987–994  ·  view source on GitHub ↗

bpo-23835 fix for ConfigParser

(self)

Source from the content-addressed store, hash-verified

985 self.assertRaises(ValueError, cf.add_section, self.default_section)
986
987 def test_defaults_keyword(self):
988 """bpo-23835 fix for ConfigParser"""
989 cf = self.newconfig(defaults={1: 2.5})
990 self.assertEqual(cf[self.default_section]['1'], '2.5')
991 self.assertAlmostEqual(cf[self.default_section].getfloat('1'), 2.5)
992 cf = self.newconfig(defaults={"A": 5.25})
993 self.assertEqual(cf[self.default_section]['a'], '5.25')
994 self.assertAlmostEqual(cf[self.default_section].getfloat('a'), 5.25)
995
996
997class ConfigParserTestCaseNoInterpolation(BasicTestCase, unittest.TestCase):

Callers

nothing calls this directly

Calls 4

getfloatMethod · 0.80
newconfigMethod · 0.45
assertEqualMethod · 0.45
assertAlmostEqualMethod · 0.45

Tested by

no test coverage detected