How to use the configupdater.NoOptionError function in ConfigUpdater

To help you get started, we’ve selected a few ConfigUpdater examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyscaffold / configupdater / tests / test_configupdater.py View on Github external
def test_get_method(setup_cfg_path):
    updater = ConfigUpdater()
    updater.read(setup_cfg_path)
    value = updater.get('metadata', 'license').value
    assert value == 'mit'
    with pytest.raises(NoSectionError):
        updater.get('non_existent_section', 'license')
    with pytest.raises(NoOptionError):
        updater.get('metadata', 'wrong_key')