summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_configparser.py
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2021-09-13 17:12:36 (GMT)
committerGitHub <noreply@github.com>2021-09-13 17:12:36 (GMT)
commit1fc41ae8709e20d741bd86c2345173688a5e84b0 (patch)
treec68e72e63a373fc3730d6d45a1e287026c088227 /Lib/test/test_configparser.py
parent85dc53a463967659075744ad911d08a32aa70dd5 (diff)
downloadcpython-1fc41ae8709e20d741bd86c2345173688a5e84b0.zip
cpython-1fc41ae8709e20d741bd86c2345173688a5e84b0.tar.gz
cpython-1fc41ae8709e20d741bd86c2345173688a5e84b0.tar.bz2
bpo-45173 Remove configparser deprecations (GH-28292)
In the configparser module, these have been deprecated since Python 3.2: * the SafeConfigParser class, * the filename property of the ParsingError class, * the readfp method of the ConfigParser class,
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r--Lib/test/test_configparser.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index e9b03e6..cedf505 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -1612,13 +1612,6 @@ class CoverageOneHundredTestCase(unittest.TestCase):
"and `source'. Use `source'.")
error = configparser.ParsingError(filename='source')
self.assertEqual(error.source, 'source')
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always", DeprecationWarning)
- self.assertEqual(error.filename, 'source')
- error.filename = 'filename'
- self.assertEqual(error.source, 'filename')
- for warning in w:
- self.assertTrue(warning.category is DeprecationWarning)
def test_interpolation_validation(self):
parser = configparser.ConfigParser()
@@ -1637,27 +1630,6 @@ class CoverageOneHundredTestCase(unittest.TestCase):
self.assertEqual(str(cm.exception), "bad interpolation variable "
"reference '%(()'")
- def test_readfp_deprecation(self):
- sio = io.StringIO("""
- [section]
- option = value
- """)
- parser = configparser.ConfigParser()
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always", DeprecationWarning)
- parser.readfp(sio, filename='StringIO')
- for warning in w:
- self.assertTrue(warning.category is DeprecationWarning)
- self.assertEqual(len(parser), 2)
- self.assertEqual(parser['section']['option'], 'value')
-
- def test_safeconfigparser_deprecation(self):
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always", DeprecationWarning)
- parser = configparser.SafeConfigParser()
- for warning in w:
- self.assertTrue(warning.category is DeprecationWarning)
-
def test_sectionproxy_repr(self):
parser = configparser.ConfigParser()
parser.read_string("""