Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions source/tests/pt_expt/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ def fake_entry_points(*, group=None):
]:
sys.modules.pop(k, None)
sys.modules.update(saved)
if deepmd_pkg is not None and "deepmd.pt_expt" in saved:
deepmd_pkg.pt_expt = saved["deepmd.pt_expt"]
if deepmd_pkg is not None:
if "deepmd.pt_expt" in saved:
deepmd_pkg.pt_expt = saved["deepmd.pt_expt"]
elif hasattr(deepmd_pkg, "pt_expt"):
# deepmd.pt_expt was not imported before this test; the fresh
# import bound it onto the parent package, so drop that stale
# attribute to leave the parent exactly as we found it.
delattr(deepmd_pkg, "pt_expt")

assert groups == ["deepmd.pt_expt"]
assert calls == ["load"]
Loading