Skip to content

Commit dfabd05

Browse files
committed
TST: Add test for deprecated import path
FIX
1 parent 124b5e5 commit dfabd05

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Unit test(s) for old PACKMOL wrapper import path."""
2+
3+
import pytest
4+
5+
from openff.interchange.warnings import InterchangeDeprecationWarning
6+
7+
8+
def test_deprecation_warning_thrown():
9+
with pytest.warns(
10+
InterchangeDeprecationWarning,
11+
match="openff.interchange.packmol` instead",
12+
):
13+
from openff.interchange.components._packmol import UNIT_CUBE # noqa: F401

openff/interchange/components/_packmol.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
solvate_topology,
1111
solvate_topology_nonwater,
1212
)
13+
from openff.interchange.warnings import InterchangeDeprecationWarning
1314

1415
__all__ = (
1516
"RHOMBIC_DODECAHEDRON",
@@ -23,5 +24,6 @@
2324
import warnings
2425

2526
warnings.warn(
26-
"This submodule is now part of the public API. Import from `openff.interchange.packmol instead.",
27+
"This submodule is now part of the public API. Import from `openff.interchange.packmol` instead.",
28+
InterchangeDeprecationWarning,
2729
)

0 commit comments

Comments
 (0)