Skip to content

Commit

Permalink
Update no-nglview test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Aug 31, 2023
1 parent a606ce6 commit 0f04675
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion devtools/conda-envs/rdkit-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies:
- bson
- msgpack-python
- qcelemental
- qcportal >=0.15
- qcportal ==0.15.8
- qcengine
- nbval
- mdtraj
Expand Down
9 changes: 8 additions & 1 deletion openff/toolkit/_tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3745,8 +3745,15 @@ def test_visualize_openeye(self):
)
def test_ipython_repr_no_nglview(self):
"""Test that the default Molecule repr does not break when nglview is not installed"""
from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE

molecule = Molecule().from_smiles("CCO")
molecule._ipython_display_()

if RDKIT_AVAILABLE:
# the default is `backend="rdkit"`
molecule.visualize()
elif OPENEYE_AVAILABLE:
molecule.visualize(backend="openeye")

def test_get_coordinates(self):
from openff.toolkit.utils.viz import _OFFTrajectoryNGLView
Expand Down

0 comments on commit 0f04675

Please sign in to comment.