Fully remove ConfigAPI.val
This commit is contained in:
parent
3be7299cb4
commit
42039eee99
@ -131,7 +131,6 @@ class ConfigAPI:
|
||||
Attributes:
|
||||
_config: The main Config object to use.
|
||||
_keyconfig: The KeyConfig object.
|
||||
val: A matching ConfigContainer object.
|
||||
load_autoconfig: Whether autoconfig.yml should be loaded.
|
||||
errors: Errors which occurred while setting options.
|
||||
"""
|
||||
@ -141,7 +140,6 @@ class ConfigAPI:
|
||||
self._keyconfig = keyconfig
|
||||
self.load_autoconfig = True
|
||||
self.errors = []
|
||||
self.val = None # Set when initialized
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _handle_error(self, action, name):
|
||||
|
@ -284,6 +284,8 @@ class TestConfigPy:
|
||||
error = api.errors[0]
|
||||
assert error.text == "Unhandled exception"
|
||||
assert isinstance(error.exception, AttributeError)
|
||||
message = "'ConfigAPI' object has no attribute 'val'"
|
||||
assert str(error.exception) == message
|
||||
|
||||
@pytest.mark.parametrize('line', ["c.foo = 42", "config.set('foo', 42)"])
|
||||
def test_config_error(self, confpy, line):
|
||||
|
Loading…
Reference in New Issue
Block a user