Skip to content

Commit

Permalink
Nitpick: refactor variable naming to allow single-line assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison committed Aug 11, 2024
1 parent 35a3b9b commit 36f5313
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_extensions/test_ext_intersphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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')
Expand Down

0 comments on commit 36f5313

Please sign in to comment.