Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Jul 14, 2023
1 parent 5108c15 commit d41c6f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: openff-fragmenter-test

channels:
- conda-forge
Expand Down
5 changes: 3 additions & 2 deletions openff/fragmenter/tests/test_chemi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ToolkitRegistry,
)
from openff.units import unit
from openff.utilities import MissingOptionalDependencyError


def test_assign_elf10_am1_bond_orders():
Expand Down Expand Up @@ -151,7 +152,7 @@ def test_find_stereocenters(smiles, expected_atoms, expected_bonds, find_method)

try:
stereogenic_atoms, stereogenic_bonds = find_method(molecule)
except ModuleNotFoundError as e:
except (ModuleNotFoundError, MissingOptionalDependencyError) as e:
pytest.skip(str(e))

assert stereogenic_atoms == expected_atoms
Expand Down Expand Up @@ -202,7 +203,7 @@ def test_extract_fragment(smiles, atoms, bonds, expected, extract_method):

try:
fragment = extract_method(molecule, atoms, bonds)
except ModuleNotFoundError as e:
except (ModuleNotFoundError, MissingOptionalDependencyError) as e:
pytest.skip(str(e))

expected_fragment = Molecule.from_smiles(expected)
Expand Down
5 changes: 3 additions & 2 deletions openff/fragmenter/tests/test_depiction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
)
from openff.fragmenter.fragment import Fragment, FragmentationResult
from openff.toolkit.topology import Molecule
from openff.utilities import MissingOptionalDependencyError


@pytest.mark.parametrize("draw_function", [_oe_render_parent, _rd_render_parent])
Expand All @@ -21,7 +22,7 @@ def test_xx_render_parent(draw_function):
"[C:1]([H:5])([H:6])([H:7])[C:2]([H:8])([H:9])[C:3]([H:10])([H:11])[C:4]([H:12])([H:13])([H:14])"
)
)
except ModuleNotFoundError as e:
except (ModuleNotFoundError, MissingOptionalDependencyError) as e:
pytest.skip(str(e))

assert isinstance(svg_contents, str)
Expand All @@ -41,7 +42,7 @@ def test_xx_render_fragment(draw_function):
(1, 2),
)

except ModuleNotFoundError as e:
except (ModuleNotFoundError, MissingOptionalDependencyError) as e:
pytest.skip(str(e))

assert isinstance(svg_contents, str)
Expand Down

0 comments on commit d41c6f4

Please sign in to comment.