Skip to content

tests: use INDICONFIG-scoped temp dir instead of ~/.indi for cordwrap config tests - #1357

Closed
jochym with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-code-review-comment
Closed

jochym with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-code-review-comment

Conversation

Copilot AI commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

System tests for cord-wrap config persistence were reading and writing ~/.indi/Celestron AUX_config.xml directly — clobbering a developer's real driver config and creating test order/environment dependencies.

Changes

  • conftest.py: Added a session-scoped local_config_dir fixture that creates a pytest-managed temp directory and sets INDICONFIG to it. indiserver_process now depends on this fixture, ensuring the env var is in place before the driver process starts.
@pytest.fixture(scope="session")
def local_config_dir(tmp_path_factory):
    config_dir = tmp_path_factory.mktemp("indi_config")
    os.environ["INDICONFIG"] = str(config_dir)
    yield str(config_dir)
    os.environ.pop("INDICONFIG", None)

@pytest.fixture(scope="session")
def indiserver_process(simulator_process, local_config_dir):
    ...
  • test_cordwrap.py (new): get_config_value() reads os.environ["INDICONFIG"] with no ~/.indi fallback — a missing env var raises KeyError rather than silently reading the real user config.

Copilot AI changed the title [WIP] Fix code to use local config files tests: use INDICONFIG-scoped temp dir instead of ~/.indi for cordwrap config tests Jul 22, 2026
Copilot AI requested a review from jochym July 22, 2026 12:48
@jochym jochym closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants