Skip to content

test: fix broken tests and add parser tests (1 to 28 passing)#51

Merged
ericchansen merged 2 commits intomasterfrom
fix/expand-tests
Mar 17, 2026
Merged

test: fix broken tests and add parser tests (1 to 28 passing)#51
ericchansen merged 2 commits intomasterfrom
fix/expand-tests

Conversation

@ericchansen
Copy link
Copy Markdown
Owner

Summary

Fix all broken tests and add new parser tests. Test count: 1 → 28 passing.

Changes

test_datatypes.py (was: 8 failures → now: 9 passing)

  • Tests called self.ff.match_mm3_bond() as class methods, but they're module-level functions
  • Rewrote to call match_mm3_bond(), match_mm3_angle(), etc. directly
  • Added negative test case (match_mm3_bond(' 2') should be False)

test_seminario.py (was: 1 failure → now: 11 passing)

  • Old test referenced test/ethane/ directory that was never committed
  • Rewrote with 4 test classes using existing fixture data:
    • TestGaussLogParsing — parses GS.log and TS.log from q2mm_example/amber/Ethane/
    • TestMol2Parsing — verifies ethane has 8 atoms and 7 bonds
    • TestMM3FFParsing — parses rh-seminario/mm3.fld, checks bond/angle params
    • TestHessianMassWeighting — mass-weight roundtrip preserves Hessian

CI

  • Removed --ignore flags from pytest — all test files now run clean

Test Results

28 passed, 16 skipped, 1 xfailed
  • 16 skipped: require Schrodinger MacroModel (commercial)
  • 1 xfailed: pre-existing upstream bug in test_replace_neg_eigenvalue

- Fix test_datatypes.py: call module-level match_mm3_* functions
  instead of non-existent class methods. Add negative test case.
  (8 → 9 tests)
- Rewrite test_seminario.py: replace missing test/ethane/ fixtures
  with tests using existing repo data (q2mm_example/amber/Ethane/,
  rh-seminario/mm3.fld). Add GaussLog, Mol2, MM3 parser tests and
  Hessian mass-weight roundtrip test. (0 → 11 tests)
- Remove CI --ignore flags since both test files now pass
- Results: 28 passed, 16 skipped, 1 xfailed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Python test suite to eliminate previously broken tests and expand coverage for file parsing/mass-weighting logic using committed ethane and MM3 fixture data, and re-enables running the full test suite in CI.

Changes:

  • Rewrites test_seminario.py to use existing q2mm_example/amber/Ethane/ and rh-seminario/ fixtures (Gaussian log parsing, mol2 parsing, MM3 parsing, Hessian mass-weighting roundtrip).
  • Fixes test_datatypes.py to call MM3 label-matching helpers as module-level functions and adds negative cases.
  • Removes pytest --ignore flags so all tests run in CI.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
test/test_seminario.py Replaces missing-fixture-based tests with new parsing and Hessian mass-weighting tests using committed example data.
test/test_datatypes.py Switches from star import/class-method calls to explicit imports and direct calls; adds negative label-matching assertions.
.github/workflows/ci.yml Runs the full pytest suite (no ignores) across the Python version matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread test/test_seminario.py Outdated
Comment thread test/test_seminario.py Outdated
Comment thread test/test_datatypes.py Outdated
Comment thread test/test_datatypes.py Outdated
Comment thread test/test_seminario.py
- Remove unused imports from test_seminario.py (copy, os, logging,
  linear_algebra, MacroModelLog, seminario, utilities)
- Remove unused SEMINARIO_DIR constant
- Remove unused MM3 import from test_datatypes.py
- Replace random test with deterministic label set (a1..z1)
- Add TS.log to skipUnless condition for TestGaussLogParsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen merged commit 68cb8e0 into master Mar 17, 2026
6 checks passed
@ericchansen ericchansen deleted the fix/expand-tests branch March 17, 2026 16:59
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