Strengthen unit test suite across eval, features, inference, models, split, and CLI#549
Open
smcolby wants to merge 4 commits into
Open
Strengthen unit test suite across eval, features, inference, models, split, and CLI#549smcolby wants to merge 4 commits into
smcolby wants to merge 4 commits into
Conversation
…split, and CLI Apply testing standards from remove-parent-spec branch across the broad unit test suite. Key changes: - Replace integration-style tests with real lightweight components - Remove MagicMock abuse on systems under test; keep mocks only for I/O - Add pytest.approx throughout to prevent cross-platform floating-point failures - Add mutual-exclusion assertions for all splitter tests - Strengthen test_inference.py: real FingerprintFeaturizer, DummyRegressorModel, CommitteeRegressor; assert derived math values (PRED=1.0, STD=1.0, UCB=4.0) - Add NumPy-style docstrings to all test functions - Update test_cli.py for spec.run() call path (PR 3 API) - test_eval.py: preserves RAE/log tests from main + docstrings/pytest.approx - test_base.py: preserves weights_only load test from main + docstrings - test_mtenn.py: not included (module deleted in main via #529) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve conflict in test_comparison.py: adopt ["stat"] dict key from main (posthoc.py return structure change) while preserving pytest.approx() assertions from this branch per testing standards. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
- Add autospec=True to inference_func and from_recipe patches in test_cli.py; convert mock_spec to create_autospec(AnvilSpecification, instance=True) - Add autospec=True to both load_anvil_model_and_metadata patches in test_inference.py - Add autospec=True to both featurize patches in test_features.py - Replace monkeypatch.setattr + unittest.mock.Mock with mocker.patch / mocker.Mock in test_base.py; add docstring; remove stale import Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Applies the new unit testing standards (introduced in #534) across the remainder of the unit test suite.
Changes
test_cli.py— Replace integration-style subprocess calls with direct function invocation;mocker-based patching for I/O side effectstest_comparison.py— Strengthen float assertions withpytest.approx(); adopt updatedlevene["stat"]dict key from posthoc refactortest_data.py— Add missing docstrings; strengthen assertionstest_eval.py— Add docstrings; strengthen existing assertions (preserves RAE/log-unit metric tests from main)test_features.py— Add mutual-exclusion checks on feature outputs; removeMagicMockon system under testtest_nepare.py— Add missing docstringstest_inference.py— Full rewrite: real lightweight components,pytest-mockfor side effects only,isinstanceguards on outputstest_base.py— Add missing docstrings (preservesweights_onlyload test from main)test_lgbm.py— Add docstrings; strengthen assertions withpytest.approx()test_splitters.py— Add mutual-exclusion assertions on all split strategies; diverse synthetic SMILES for scaffold/cluster splitsQuality Assurance & AI Policy
To maintain project quality and respect maintainer bandwidth, please confirm the following:
Status
Developers Certificate of Origin
Note to Contributors: We reserve the right to close PRs without review if they appear to lack human validation or do not meet the quality standards described in our
CONTRIBUTING.md.