From 36f5313e777ddfb5a0137242130d768809bb512b Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 11 Aug 2024 15:52:49 +0100 Subject: [PATCH] Nitpick: refactor variable naming to allow single-line assertion --- tests/test_extensions/test_ext_intersphinx.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/test_extensions/test_ext_intersphinx.py b/tests/test_extensions/test_ext_intersphinx.py index b107db36a70..e4b2c0d2ffe 100644 --- a/tests/test_extensions/test_ext_intersphinx.py +++ b/tests/test_extensions/test_ext_intersphinx.py @@ -314,13 +314,13 @@ def test_missing_reference_stddomain(tmp_path, app): @pytest.mark.parametrize( - ('term', 'is_ambiguous'), + ('term', 'expected_ambiguity'), [ ('A TERM', False), ('B TERM', True), ], ) -def test_ambiguous_reference_handling(term, is_ambiguous, tmp_path, app, warning): +def test_ambiguous_reference_handling(term, expected_ambiguity, tmp_path, app, warning): inv_file = tmp_path / 'inventory' inv_file.write_bytes(INVENTORY_V2_AMBIGUOUS_TERMS) set_config( @@ -338,10 +338,8 @@ def test_ambiguous_reference_handling(term, is_ambiguous, tmp_path, app, warning node, contnode = fake_node('std', 'term', term, term) missing_reference(app, app.env, node, contnode) - reported_ambiguous = ( - f'multiple matches found for std:term:{term}' in warning.getvalue() - ) - assert is_ambiguous is reported_ambiguous + ambiguity = f'multiple matches found for std:term:{term}' in warning.getvalue() + assert ambiguity is expected_ambiguity @pytest.mark.sphinx('html', testroot='ext-intersphinx-cppdomain')