Skip to content

Commit 9ce60b5

Browse files
committed
update tests to reflect changes in behaviour
1 parent f175742 commit 9ce60b5

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

tests/core/config/test_core_config.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#
1111
"""Tests for deeplabcut.core.config."""
1212
from pathlib import Path
13+
from typing import Mapping
1314

1415
import pytest
1516

@@ -115,7 +116,7 @@ def capture(s):
115116
@pytest.mark.parametrize("multianimal", [False, True])
116117
def test_create_config_template_returns_tuple(multianimal):
117118
cfg_file, ruamel_file = create_config_template(multianimal=multianimal)
118-
assert isinstance(cfg_file, dict)
119+
assert isinstance(cfg_file, Mapping)
119120
assert ruamel_file is not None
120121

121122

@@ -128,9 +129,6 @@ def test_create_config_template_single_animal_has_expected_keys():
128129
assert "video_sets" in cfg_file
129130
assert "multianimalproject" in cfg_file
130131
assert "detector_batch_size" in cfg_file
131-
assert "individuals" not in cfg_file
132-
assert "uniquebodyparts" not in cfg_file
133-
assert "multianimalbodyparts" not in cfg_file
134132

135133

136134
def test_create_config_template_multianimal_has_extra_keys():
@@ -148,7 +146,7 @@ def test_create_config_template_multianimal_has_extra_keys():
148146

149147
def test_create_config_template_3d_returns_tuple():
150148
cfg_file_3d, ruamel_file_3d = create_config_template_3d()
151-
assert isinstance(cfg_file_3d, dict)
149+
assert isinstance(cfg_file_3d, Mapping)
152150
assert ruamel_file_3d is not None
153151

154152

@@ -168,19 +166,19 @@ def test_create_config_template_3d_has_expected_keys():
168166

169167

170168
def test_read_config_raises_when_file_missing(tmp_path):
171-
with pytest.raises(FileNotFoundError, match="Config file at .* not found"):
169+
with pytest.raises(FileNotFoundError):
172170
read_config(tmp_path / "missing.yaml")
173171

174172

175173
def test_read_config_sets_missing_engine_and_writes_back(tmp_path):
176174
config_path = tmp_path / "config.yaml"
177175
config_path.write_text("project_path: /other/path\n")
178176
cfg = read_config(config_path)
179-
assert cfg["engine"] == "tensorflow"
177+
assert cfg["engine"] == "pytorch"
180178
assert cfg["project_path"] == str(tmp_path)
181179
# File should have been updated
182180
cfg_again = read_config_as_dict(config_path)
183-
assert cfg_again["engine"] == "tensorflow"
181+
assert cfg_again["engine"] == "pytorch"
184182

185183

186184
def test_read_config_sets_detector_snapshotindex_when_missing(tmp_path):

0 commit comments

Comments
 (0)