summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_config.py
diff options
context:
space:
mode:
authoridle sign <idlesign@yandex.ru>2016-12-10 12:06:26 +0700
committerJason R. Coombs <jaraco@jaraco.com>2016-12-10 11:23:00 -0500
commit56dea7f0334f60603d4ca6a884ca523fe3389ef3 (patch)
tree0bd0b074883e4d04d87a22fae43c70d9ded5cf8f /setuptools/tests/test_config.py
parentac9997648d89131412eacbb198e2d3a7c97f69e4 (diff)
downloadpython-setuptools-git-56dea7f0334f60603d4ca6a884ca523fe3389ef3.tar.gz
`read_configuration()` now accepts `ignore_option_errors`.
Diffstat (limited to 'setuptools/tests/test_config.py')
-rw-r--r--setuptools/tests/test_config.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py
index 21487720..aaf78aef 100644
--- a/setuptools/tests/test_config.py
+++ b/setuptools/tests/test_config.py
@@ -73,6 +73,22 @@ class TestConfigurationReader:
with pytest.raises(DistutilsFileError):
read_configuration('%s' % tmpdir.join('setup.cfg'))
+ def test_ignore_errors(self, tmpdir):
+ fake_env(
+ tmpdir,
+ '[metadata]\n'
+ 'version = attr: none.VERSION\n'
+ 'keywords = one, two\n'
+ )
+ with pytest.raises(ImportError):
+ read_configuration('%s' % tmpdir.join('setup.cfg'))
+
+ config_dict = read_configuration(
+ '%s' % tmpdir.join('setup.cfg'), ignore_option_errors=True)
+
+ assert config_dict['metadata']['keywords'] == ['one', 'two']
+ assert 'version' not in config_dict['metadata']
+
class TestMetadata: