Skip to content

Commit f4dc9d9

Browse files
committed
test(test_conf.py): add a test case for --config option
1 parent c3228cc commit f4dc9d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_conf.py

+9
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ def test_load_empty_pyproject_toml_and_cz_toml_with_config(_, tmpdir):
158158
cfg = config.read_cfg()
159159
assert cfg.settings == _settings
160160

161+
def test_load_pyproject_toml_not_in_root_folder(_, tmpdir):
162+
with tmpdir.as_cwd():
163+
_not_root_path = tmpdir.mkdir("not_in_root")
164+
p = tmpdir.join("./not_in_root/pyproject.toml")
165+
p.write(PYPROJECT)
166+
167+
cfg = config.read_cfg(filepath="./not_in_root/pyproject.toml")
168+
assert cfg.settings == _settings
169+
161170

162171
class TestTomlConfig:
163172
def test_init_empty_config_content(self, tmpdir):

0 commit comments

Comments
 (0)