Skip to content

Modernize assertions in test_pqr.py (Contributes to #3743) - #5574

Open
anandkaranubc wants to merge 1 commit into
MDAnalysis:developfrom
anandkaranubc:modernize-test-pqr-asserts
Open

anandkaranubc wants to merge 1 commit into
MDAnalysis:developfrom
anandkaranubc:modernize-test-pqr-asserts

Conversation

@anandkaranubc

Copy link
Copy Markdown

Contributes to #3743

Changes made in this Pull Request:

  • Modernized assertions in testsuite/MDAnalysisTests/topology/test_pqr.py
  • Replaced deprecated assert_almost_equal with numpy.testing.assert_allclose
  • Replaced scalar float comparisons with pytest.approx
  • Preserved precision behavior
  • No behavioral changes introduced

PR Checklist

  • Issue raised/referenced? (Contributes to modernize testing code #3743)
  • Tests updated/added? (Updated test assertions)
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS?
  • I have read and understand the current AI Policy
  • LLM/AI disclosure was updated.

LLM / AI generated code disclosure

  • I have read and understood MDAnalysis's AI policy in AI_POLICY.md.

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes
They were only used for brainstorming ideas and confirming my authored changes.

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.

@read-the-docs-community

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · MDAnalysis · built Dec. 3, 2026, 8:49 p.m. UTC

@anandkaranubc

Copy link
Copy Markdown
Author

NumPy defines decimal=d as abs(desired-actual) < 1.5 * 10**(-d) (docs), so that's why pytest.approx was used with the updated tolerance.

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.96%. Comparing base (396a4cd) to head (157cd68).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5574   +/-   ##
========================================
  Coverage    93.96%   93.96%           
========================================
  Files          184      184           
  Lines        22679    22679           
  Branches      3228     3228           
========================================
  Hits         21310    21310           
  Misses         911      911           
  Partials       458      458           

☔ 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.

This branch has not been deployed

No deployments
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.

1 participant