@@ -114,7 +114,7 @@ def basic_test(self, cf):
114
114
115
115
# The use of spaces in the section names serves as a
116
116
# regression test for SourceForge bug #583248:
117
- # http ://www .python.org/sf/583248
117
+ # https ://bugs .python.org/issue583248
118
118
119
119
# API access
120
120
eq (cf .get ('Foo Bar' , 'foo' ), 'bar1' )
@@ -934,7 +934,7 @@ def test_items(self):
934
934
('name' , 'value' )])
935
935
936
936
def test_safe_interpolation (self ):
937
- # See http ://www .python.org/sf/511737
937
+ # See https ://bugs .python.org/issue511737
938
938
cf = self .fromstring ("[section]\n "
939
939
"option1{eq}xxx\n "
940
940
"option2{eq}%(option1)s/xxx\n "
@@ -1614,23 +1614,12 @@ def test_interpolation_depth_error(self):
1614
1614
self .assertEqual (error .section , 'section' )
1615
1615
1616
1616
def test_parsing_error (self ):
1617
- with self .assertRaises (ValueError ) as cm :
1617
+ with self .assertRaises (TypeError ) as cm :
1618
1618
configparser .ParsingError ()
1619
- self .assertEqual (str (cm .exception ), "Required argument `source' not "
1620
- "given." )
1621
- with self .assertRaises (ValueError ) as cm :
1622
- configparser .ParsingError (source = 'source' , filename = 'filename' )
1623
- self .assertEqual (str (cm .exception ), "Cannot specify both `filename' "
1624
- "and `source'. Use `source'." )
1625
- error = configparser .ParsingError (filename = 'source' )
1619
+ error = configparser .ParsingError (source = 'source' )
1620
+ self .assertEqual (error .source , 'source' )
1621
+ error = configparser .ParsingError ('source' )
1626
1622
self .assertEqual (error .source , 'source' )
1627
- with warnings .catch_warnings (record = True ) as w :
1628
- warnings .simplefilter ("always" , DeprecationWarning )
1629
- self .assertEqual (error .filename , 'source' )
1630
- error .filename = 'filename'
1631
- self .assertEqual (error .source , 'filename' )
1632
- for warning in w :
1633
- self .assertTrue (warning .category is DeprecationWarning )
1634
1623
1635
1624
def test_interpolation_validation (self ):
1636
1625
parser = configparser .ConfigParser ()
@@ -1649,27 +1638,6 @@ def test_interpolation_validation(self):
1649
1638
self .assertEqual (str (cm .exception ), "bad interpolation variable "
1650
1639
"reference '%(()'" )
1651
1640
1652
- def test_readfp_deprecation (self ):
1653
- sio = io .StringIO ("""
1654
- [section]
1655
- option = value
1656
- """ )
1657
- parser = configparser .ConfigParser ()
1658
- with warnings .catch_warnings (record = True ) as w :
1659
- warnings .simplefilter ("always" , DeprecationWarning )
1660
- parser .readfp (sio , filename = 'StringIO' )
1661
- for warning in w :
1662
- self .assertTrue (warning .category is DeprecationWarning )
1663
- self .assertEqual (len (parser ), 2 )
1664
- self .assertEqual (parser ['section' ]['option' ], 'value' )
1665
-
1666
- def test_safeconfigparser_deprecation (self ):
1667
- with warnings .catch_warnings (record = True ) as w :
1668
- warnings .simplefilter ("always" , DeprecationWarning )
1669
- parser = configparser .SafeConfigParser ()
1670
- for warning in w :
1671
- self .assertTrue (warning .category is DeprecationWarning )
1672
-
1673
1641
def test_legacyinterpolation_deprecation (self ):
1674
1642
with warnings .catch_warnings (record = True ) as w :
1675
1643
warnings .simplefilter ("always" , DeprecationWarning )
@@ -1843,7 +1811,7 @@ def test_parsingerror(self):
1843
1811
self .assertEqual (e1 .source , e2 .source )
1844
1812
self .assertEqual (e1 .errors , e2 .errors )
1845
1813
self .assertEqual (repr (e1 ), repr (e2 ))
1846
- e1 = configparser .ParsingError (filename = 'filename' )
1814
+ e1 = configparser .ParsingError ('filename' )
1847
1815
e1 .append (1 , 'line1' )
1848
1816
e1 .append (2 , 'line2' )
1849
1817
e1 .append (3 , 'line3' )
0 commit comments