11# SPDX-License-Identifier: LGPL-3.0-or-later
2- """Contract tests for ``deepmd. dpa_adapt._backend``.
2+ """Contract tests for ``dpa_adapt._backend``.
33
44These tests call **real** deepmd APIs — no mocks — on a minimal synthetic
55DPA-3 descriptor model. Their purpose is to catch silent breakage when
@@ -134,7 +134,7 @@ class TestBackendContract:
134134 def _require_deepmd (self ):
135135 """Skip if the deepmd model builder is not usable."""
136136 try :
137- from deepmd . dpa_adapt ._backend import (
137+ from dpa_adapt ._backend import (
138138 build_model_from_config ,
139139 )
140140
@@ -147,7 +147,7 @@ def _extractor(self):
147147 """Build a model + extractor, yield it, then **always** disable the
148148 descriptor hook so a test failure never leaks global state.
149149 """
150- from deepmd . dpa_adapt ._backend import (
150+ from dpa_adapt ._backend import (
151151 _DescriptorExtraction ,
152152 build_model_from_config ,
153153 )
@@ -163,7 +163,7 @@ def _extractor(self):
163163
164164 def test_build_model_from_config (self ):
165165 """``build_model_from_config`` succeeds with minimal config."""
166- from deepmd . dpa_adapt ._backend import (
166+ from dpa_adapt ._backend import (
167167 build_model_from_config ,
168168 )
169169
@@ -258,7 +258,7 @@ def test_get_torch_device_returns_device(self):
258258 if isinstance (sys .modules .get ("torch" ), MagicMock ):
259259 pytest .skip ("torch is mocked by another test" )
260260
261- from deepmd . dpa_adapt ._backend import (
261+ from dpa_adapt ._backend import (
262262 get_torch_device ,
263263 )
264264
@@ -276,7 +276,7 @@ def test_load_torch_file_roundtrip(self, tmp_path):
276276
277277 import torch
278278
279- from deepmd . dpa_adapt ._backend import (
279+ from dpa_adapt ._backend import (
280280 load_torch_file ,
281281 )
282282
@@ -296,7 +296,7 @@ def test_freeze_bundle_has_format_version(self, tmp_path):
296296 patch ,
297297 )
298298
299- from deepmd . dpa_adapt import (
299+ from dpa_adapt import (
300300 DPAFineTuner ,
301301 )
302302
@@ -322,7 +322,7 @@ def _fake_extract(self, systems):
322322 ft .fit (str (system ), target_key = "energy" )
323323 frozen = ft .freeze (str (tmp_path / "model.pth" ))
324324
325- from deepmd . dpa_adapt ._backend import (
325+ from dpa_adapt ._backend import (
326326 load_torch_file ,
327327 )
328328
0 commit comments