Skip to content

Test cleanup#570

Merged
kaklise merged 14 commits into
USEPA:mainfrom
kbonney:test-cleanup
Jun 25, 2026
Merged

Test cleanup#570
kaklise merged 14 commits into
USEPA:mainfrom
kbonney:test-cleanup

Conversation

@kbonney

@kbonney kbonney commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Provide a summary of the proposed changes, describe tests and documentation, and review the acknowledgement below.

Summary

  • Summarize changes, including issues that are resolved by this pull request

The primary purpose of this PR is developer quality of life for testing. The two main issues addressed are:

  • Running the test suite currently produces a large amount of artifacts which clutters the dev environment
  • Certain ways of the running the test suite are blocked by plots produced by the graphics tests and require these to be manually closed in order to continue testing.

These two issues are solved by introducing conftest.py, a configuration file utilized by pytest. In this file we introduce logic that changes the working directory while testing to either a temp directory that is destroyed upon tests finishing or a custom directory that is not destroyed (for cases where the developer wants to investigate the test artifacts). Additionally, the MPL plotting backend is coerced to "Agg" which is non-interactive and prevents windows from spawning and blocking progress.

Common directories used for testing are also stored in conftest.py so that they are easily importable by all test files in a uniform way (rather than repeating boilerplate path generations in ~40 files).

Tests and documentation

  • Describe tests and documentation for new features

n/a

AI Disclosure

If you submit code generated using AI tools:

  • Disclose the AI tools that were used (e.g., GitHub Copilot, ChatGPT)
  • Describe the use of AI (e.g., generate concept/idea, code generation, code refactoring, documentation generation, code test generation)

Acknowledgement

By contributing to WNTR, I acknowledge that I have reviewed the software quality assurance guidelines and agree to the following terms and conditions for my contribution:

  1. I agree that my contributions are submitted under the Revised BSD License.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
  3. If code was generated using AI tools, I have disclosed the use of AI and reviewed all code for quality assurance, correctness, security, and licensing.

@kbonney

kbonney commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Updates:

  • Collapsed examples/.gitignore into ./.gitignore

@kaklise
kaklise merged commit 2a69d56 into USEPA:main Jun 25, 2026
24 checks passed
@kbonney
kbonney deleted the test-cleanup branch July 2, 2026 10:35
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