Skip to content

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.

@codecov
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 21 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.

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

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.

@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
kmodali pushed a commit to kmodali/pystac that referenced this pull request Oct 16, 2025
…utils#1516)

* 993 convert test_version.py to pytest

* 993 convert test_item.py to pytest

* 993 apply pre-commit fixes

* 993 replace function with fixture

---------

Co-authored-by: Pete Gadomski <[email protected]>
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