Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s testing and packaging configuration to support newer pytest versions, consolidating legacy setup.cfg pytest settings into pyproject.toml and adjusting tests/envs to reduce warnings and improve compatibility.
Changes:
- Remove legacy pytest settings from
setup.cfgand migrate pytest/coverage configuration intopyproject.toml. - Update several tests to use updated APIs/import styles (notably OpenMM imports and topology/position handling).
- Refresh conda test environments (pytest version pinning adjustments; add
pytest-timeoutto additional envs).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.cfg | Removes legacy [tool:pytest] configuration (migration to pyproject.toml). |
| pyproject.toml | Adds pytest ini options and consolidates coverage settings; updates setuptools config stanza. |
| openff/toolkit/_tests/test_topology.py | Refactors imports and several tests to new construction patterns; warning cleanup. |
| openff/toolkit/_tests/test_parameters.py | Switches to from_mapped_smiles for mapped SMILES inputs. |
| openff/toolkit/_tests/test_forcefield.py | Normalizes expected exception-match metadata in a parameter matrix. |
| devtools/conda-envs/test_env.yaml | Adjusts dependency constraints and pytest pinning. |
| devtools/conda-envs/rdkit.yaml | Adds pytest-timeout. |
| devtools/conda-envs/rdkit-examples.yaml | Adds pytest-timeout. |
| devtools/conda-envs/openeye.yaml | Adds pytest-timeout. |
Comments suppressed due to low confidence (1)
openff/toolkit/_tests/test_forcefield.py:723
partial_charge_method_resolution_matrixmostly usesexception_match: Nonewhen no exception is expected, but this OpenEye/Gasteiger entry still uses an empty string. For consistency (and to avoid confusion about whether the field is meaningful whenexceptionisNone), consider switching this toNoneas well (or omitting the key whenexceptionisNone).
"toolkit": OpenEyeToolkitWrapper,
"partial_charge_method": "Gasteiger",
"exception": None,
"exception_match": "",
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| "partial_charge_method": "AM1-Mulliken", | ||
| "exception": None, | ||
| "exception_match": "", | ||
| "exception_match": None, |
There was a problem hiding this comment.
See any recent logs with
/home/runner/micromamba/envs/openff-toolkit-test/lib/python3.11/site-packages/_pytest/raises.py:624: PytestWarning: matching against an empty string will *always* pass. If you want to check for an empty message you need to pass '^$'. If you don't want to match you should pass `None` or leave out the parameter.
| def test_visualize_basic(self): | ||
| import nglview | ||
|
|
||
| topology = Topology.from_pdb( | ||
| get_data_file_path( | ||
| "systems/test_systems/T4_lysozyme_water_ions.pdb", | ||
| ) | ||
| ) | ||
|
|
||
| assert isinstance(topology.visualize(), nglview.NGLWidget) |
There was a problem hiding this comment.
This test takes 100 seconds on my system, confusingly
$ pytest --durations=10 openff/toolkit/_tests/test_topology.py --runslow
===================================================== slowest 10 durations ======================================================
113.81s call openff/toolkit/_tests/test_topology.py::TestTopologyVisaulization::test_visualize_basic
1.36s call openff/toolkit/_tests/test_topology.py::TestTopologyVisaulization::test_missing_positions
0.47s call openff/toolkit/_tests/test_topology.py::TestTopology::test_from_pdb
0.43s call openff/toolkit/_tests/test_topology.py::TestTopology::test_add_molecules
0.42s call openff/toolkit/_tests/test_topology.py::TestTopology::test_chemical_environments_matches_OE
0.37s call openff/toolkit/_tests/test_topology.py::TestTopology::test_from_pdb_input_types
0.36s call openff/toolkit/_tests/test_topology.py::TestTopology::test_from_to_openmm_hierarchy_metadata
0.29s call openff/toolkit/_tests/test_topology.py::TestTopology::test_from_openmm
0.25s call openff/toolkit/_tests/test_topology.py::TestTopology::test_from_openmm_virtual_sites
0.23s setup openff/toolkit/_tests/test_topology.py::TestTopologyPositions::test_clear_and_re_set_positions
==================================== 173 passed, 2 skipped, 15 warnings in 126.56s (0:02:06) ====================================
Possibly PDB writing is slow ... ?
openff-toolkit/openff/toolkit/utils/_viz.py
Line 102 in b56ac24
Can open a new issue
Closes #2019
pytest9pyproject.toml