Skip to content

Fix config test for missing old key warning #972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion control/tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_default_deprecation(self):
ct.config.defaults['deprecated.config.oldmiss'] = 'config.newmiss'

msgpattern = r'config\.oldkey.* has been renamed to .*config\.newkey'
msgmisspattern = r'config\.oldmiss.* has been renamed to .*config\.newmiss'

ct.config.defaults['config.newkey'] = 1
with pytest.warns(FutureWarning, match=msgpattern):
Expand All @@ -77,7 +78,7 @@ def test_default_deprecation(self):
assert ct.config.defaults.get('config.oldkey') == 6

with pytest.raises(KeyError):
with pytest.warns(FutureWarning, match=msgpattern):
with pytest.warns(FutureWarning, match=msgmisspattern):
ct.config.defaults['config.oldmiss']
with pytest.raises(KeyError):
ct.config.defaults['config.neverdefined']
Expand Down