Resolve duplicate test name in test_deal_entry.py (ar-r82f.19)#96
Merged
Conversation
Delete redundant duplicate of test_deal_data_includes_v2_fields_as_top_level_keys at line 481. The function was a functional duplicate of the test at line 438 (same imports, fields, and assertions). Python silently shadowed the earlier definition, so the first test never ran. Removed the noqa: F811 marker that masked the underlying issue. The retained test (formerly line 438) is more comprehensive, including the additional `assert "metadata" not in data` check. bead: ar-r82f.19 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves bead
ar-r82f.19. The filetests/unit/test_deal_entry.pyhad two functions namedtest_deal_data_includes_v2_fields_as_top_level_keys(lines 438 and 481). Python silently shadowed the first definition with the second, meaning the line-438 test never executed. PR #95's lint sweep masked the F811 warning with# noqa: F811to keep its scope pure; this PR fixes the real bug.What changed
# noqa: F811marker on the same line.The two tests were functional duplicates:
ManualDealEntry/create_manual_dealfromad_buyer.tools.deal_library.deal_entry.ManualDealEntrywith the same v2 fields (only thedisplay_nameanddescriptionstring values differed).data["seller_org"],data["seller_domain"],data["seller_type"],data["buyer_org"],data["buyer_id"],data["price_model"],data["fixed_price_cpm"],data["bid_floor_cpm"],data["currency"],data["media_type"],data["description"]matched the supplied entry.The retained test (line 438) is the canonical/newer version and is strictly stronger: it adds
assert "metadata" not in data, which the deleted variant did not check.git blameconfirmed line 438 was added in commit633d813(2026-03-25 14:07) after the now-removed variant in commit0bf2992(2026-03-25 13:43); the newer test was the intended replacement that simply never deleted its predecessor.Test plan
python -c "import ast; ast.parse(open('tests/unit/test_deal_entry.py').read())"-- syntax OKgrep "^def test_\|^ def test_" tests/unit/test_deal_entry.py | sort | uniq -c-- no duplicatesruff check tests/unit/test_deal_entry.py-- all checks passedtest_deal_data_includes_v2_fields_as_top_level_keysin pytest output)bead: ar-r82f.19