@@ -175,9 +175,9 @@ def test_find_git_project_root(tmpdir):
175175 "config_files_manager" , defaults .CONFIG_FILES .copy (), indirect = True
176176)
177177def test_set_key (config_files_manager ):
178- _conf = config .read_cfg ()
178+ _conf = config .search_and_read_config_file ()
179179 _conf .set_key ("version" , "2.0.0" )
180- cfg = config .read_cfg ()
180+ cfg = config .search_and_read_config_file ()
181181 assert cfg .settings == _new_settings
182182
183183
@@ -186,12 +186,12 @@ class TestReadCfg:
186186 "config_files_manager" , defaults .CONFIG_FILES .copy (), indirect = True
187187 )
188188 def test_load_conf (_ , config_files_manager ):
189- cfg = config .read_cfg ()
189+ cfg = config .search_and_read_config_file ()
190190 assert cfg .settings == _settings
191191
192192 def test_conf_returns_default_when_no_files (_ , tmpdir ):
193193 with tmpdir .as_cwd ():
194- cfg = config .read_cfg ()
194+ cfg = config .search_and_read_config_file ()
195195 assert cfg .settings == defaults .DEFAULT_SETTINGS
196196
197197 def test_load_empty_pyproject_toml_and_cz_toml_with_config (_ , tmpdir ):
@@ -201,23 +201,25 @@ def test_load_empty_pyproject_toml_and_cz_toml_with_config(_, tmpdir):
201201 p = tmpdir .join (".cz.toml" )
202202 p .write (PYPROJECT )
203203
204- cfg = config .read_cfg ()
204+ cfg = config .search_and_read_config_file ()
205205 assert cfg .settings == _settings
206206
207207 def test_load_pyproject_toml_from_config_argument (_ , tmpdir ):
208208 with tmpdir .as_cwd ():
209209 _not_root_path = tmpdir .mkdir ("not_in_root" ).join ("pyproject.toml" )
210210 _not_root_path .write (PYPROJECT )
211211
212- cfg = config .read_cfg (filepath = "./not_in_root/pyproject.toml" )
212+ cfg = config .search_and_read_config_file (
213+ filepath = "./not_in_root/pyproject.toml"
214+ )
213215 assert cfg .settings == _settings
214216
215217 def test_load_cz_json_not_from_config_argument (_ , tmpdir ):
216218 with tmpdir .as_cwd ():
217219 _not_root_path = tmpdir .mkdir ("not_in_root" ).join (".cz.json" )
218220 _not_root_path .write (JSON_STR )
219221
220- cfg = config .read_cfg (filepath = "./not_in_root/.cz.json" )
222+ cfg = config .search_and_read_config_file (filepath = "./not_in_root/.cz.json" )
221223 json_cfg_by_class = JsonConfig (data = JSON_STR , path = _not_root_path )
222224 assert cfg .settings == json_cfg_by_class .settings
223225
@@ -226,7 +228,7 @@ def test_load_cz_yaml_not_from_config_argument(_, tmpdir):
226228 _not_root_path = tmpdir .mkdir ("not_in_root" ).join (".cz.yaml" )
227229 _not_root_path .write (YAML_STR )
228230
229- cfg = config .read_cfg (filepath = "./not_in_root/.cz.yaml" )
231+ cfg = config .search_and_read_config_file (filepath = "./not_in_root/.cz.yaml" )
230232 yaml_cfg_by_class = YAMLConfig (data = YAML_STR , path = _not_root_path )
231233 assert cfg .settings == yaml_cfg_by_class ._settings
232234
@@ -236,7 +238,9 @@ def test_load_empty_pyproject_toml_from_config_argument(_, tmpdir):
236238 _not_root_path .write ("" )
237239
238240 with pytest .raises (ConfigFileIsEmpty ):
239- config .read_cfg (filepath = "./not_in_root/pyproject.toml" )
241+ config .search_and_read_config_file (
242+ filepath = "./not_in_root/pyproject.toml"
243+ )
240244
241245
242246@pytest .mark .parametrize (
0 commit comments