Skip to content
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

993 progress: convert test_version.py & test_item.py to pytest #1516

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

teks
Copy link
Contributor

@teks teks commented Feb 2, 2025

Related Issue(s): #993

  • Instead of trying to duplicate unittest.TestCase.maxDiff = None in pytest, I
    decided to just take it out and leave it to the user to use pytest -vv if
    they want.
  • I mostly refrained from redesigning tests. My thinking is that the total Where reasonable, convert tests to free functions #993 changeset is
    already going to be enormous so don't make it worse by adding semantic density.
  • unittest's TestCase.assertCountEqual() isn't conveniently available in
    pytest. I didn't try to duplicate the exact semantics since simpler assertions
    worked just as well, ie assert set(some_object) == {"a", "b"}
  • Some classes are retained because they seem like a useful container to
    organize tests. The tests inside them were converted to pytest though.
  • There's an http metadata entry in the revised cassette, X-Cache, that was a MISS in
    the original but is a HIT here. I assume that's harmless?
  • I suggested I'd make "a few" PRs for Where reasonable, convert tests to free functions #993. I think I underestimated. 😞

PR Checklist:

  • Pre-commit hooks and tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG.

Copy link

codecov bot commented Feb 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.47%. Comparing base (69e2cb0) to head (72b1f3c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1516   +/-   ##
=======================================
  Coverage   91.47%   91.47%           
=======================================
  Files          54       54           
  Lines        7542     7542           
  Branches      915      915           
=======================================
  Hits         6899     6899           
  Misses        457      457           
  Partials      186      186           

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

Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change, in general looks good! just one question.

tests/test_item.py Outdated Show resolved Hide resolved
@gadomski gadomski enabled auto-merge February 3, 2025 17:08
@gadomski gadomski added this pull request to the merge queue Feb 3, 2025
Merged via the queue into stac-utils:main with commit 3eb3dee Feb 3, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants