Skip to content

Add the two missing asserts in test_columnaliases - #780

Merged
ManonMarchand merged 1 commit into
astropy:mainfrom
karpovantonme:fix/missing-asserts
Aug 5, 2026
Merged

Add the two missing asserts in test_columnaliases#780
ManonMarchand merged 1 commit into
astropy:mainfrom
karpovantonme:fix/missing-asserts

Conversation

@karpovantonme

Copy link
Copy Markdown
Contributor

Split out of #778 as you suggested.

dal/tests/test_query.py:586 has two statements with assert missing:

record.getbyucd('baz') is None
record.getbyutype('foobaz') is None

Both are evaluated and thrown away, so test_columnaliases does not check the last two of the four aliases it is named for.

The behaviour is already correct, so nothing changes for users. This is only about the test guarding what it claims.

Checks

$ python -m pytest pyvo/dal/tests/test_query.py -k columnaliases
2 passed

And the other direction, to show the asserts are really comparing something: flipping the first one to is not None gives 1 failed, 1 passed with AssertionError at line 586.

The two statements were evaluated and discarded, so the test did not
check what its name says. The behaviour is already correct, this is
about the test guarding it.

Verified both ways: the asserts pass as written, and flipping one to
'is not None' makes the test fail, so they are now comparing something.
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.52%. Comparing base (79f1d85) to head (ca75b99).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #780   +/-   ##
=======================================
  Coverage   80.52%   80.52%           
=======================================
  Files          90       90           
  Lines       10352    10352           
=======================================
  Hits         8336     8336           
  Misses       2016     2016           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ManonMarchand

Copy link
Copy Markdown
Member

Thanks!

@ManonMarchand
ManonMarchand merged commit 64fbf2f into astropy:main Aug 5, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants