Test init_cfg with Python file.
(self, temp_dir)
| 172 | """Tests for init_cfg function.""" |
| 173 | |
| 174 | def test_init_cfg_py(self, temp_dir): |
| 175 | """Test init_cfg with Python file.""" |
| 176 | config_path = os.path.join(temp_dir, "config.py") |
| 177 | with open(config_path, "w") as f: |
| 178 | f.write("test_key = 'test_value'\n") |
| 179 | |
| 180 | init_cfg(config_path) |
| 181 | cfg = get_cfg() |
| 182 | assert cfg.test_key == "test_value" |
| 183 | |
| 184 | def test_init_cfg_nonexistent(self, temp_dir): |
| 185 | """Test init_cfg with nonexistent file.""" |