Skip to content

Prevent baseline regeneration during testing with pixi - #68

Merged
d-montgomery merged 2 commits into
NatLabRockies:mainfrom
d-montgomery:protect-baseline
Aug 31, 2026
Merged

Prevent baseline regeneration during testing with pixi#68
d-montgomery merged 2 commits into
NatLabRockies:mainfrom
d-montgomery:protect-baseline

Conversation

@d-montgomery

Copy link
Copy Markdown
Collaborator

Running pixi run -e dev test triggered a regeneration of the baseline predictions used in the accuracy test. This PR ensures this does not happen anymore.

…ction

- Guard generate_baseline.py's regeneration logic behind if __name__ == '__main__'
  so importing the module (e.g. via pytest --doctest-modules) has no side effects
- Add --ignore for the script in pytest addopts as defense in depth

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents the baseline prediction CSVs used by accuracy tests from being regenerated unintentionally when running the test suite via pixi run -e dev test, by ensuring the baseline generation script is not executed/collected during pytest runs.

Changes:

  • Wrapped baseline CSV generation logic in tests/baselinePredictions/generate_baseline.py inside a main() guarded by if __name__ == "__main__":.
  • Updated pytest configuration (pyproject.toml) to ignore tests/baselinePredictions/generate_baseline.py during test runs (including doctest module collection).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/baselinePredictions/generate_baseline.py Moves top-level baseline generation into a main() function to prevent execution on import.
pyproject.toml Adds a pytest --ignore rule so the baseline generation script isn’t collected during testing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@d-montgomery
d-montgomery enabled auto-merge (squash) August 31, 2026 22:07
@d-montgomery
d-montgomery disabled auto-merge August 31, 2026 22:08
@d-montgomery
d-montgomery merged commit af5f226 into NatLabRockies:main Aug 31, 2026
11 checks passed
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