mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
gh-103606: raise RuntimeError if config file is invalid or empty (#104701)
(this adjusts new code) raise RuntimeError if provided config file is invalid or empty, not ValueError.
This commit is contained in:
parent
27a68be77f
commit
12f1581b0c
3 changed files with 6 additions and 6 deletions
|
@ -1781,12 +1781,12 @@ class ConfigFileTest(BaseTest):
|
|||
"""
|
||||
|
||||
file = io.StringIO(textwrap.dedent(test_config))
|
||||
self.assertRaises(ValueError, logging.config.fileConfig, file)
|
||||
self.assertRaises(RuntimeError, logging.config.fileConfig, file)
|
||||
|
||||
def test_exception_if_confg_file_is_empty(self):
|
||||
fd, fn = tempfile.mkstemp(prefix='test_empty_', suffix='.ini')
|
||||
os.close(fd)
|
||||
self.assertRaises(ValueError, logging.config.fileConfig, fn)
|
||||
self.assertRaises(RuntimeError, logging.config.fileConfig, fn)
|
||||
os.remove(fn)
|
||||
|
||||
def test_exception_if_config_file_does_not_exist(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue