Fully remove ConfigAPI.val

This commit is contained in:
Florian Bruhin 2017-09-15 19:01:03 +02:00
parent 3be7299cb4
commit 42039eee99
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -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):