Skip to content

Conversation

@jaraco
Copy link
Collaborator

@jaraco jaraco commented Apr 6, 2025

Refactored the tests to run the samples in-process instead of launching a subprocess, giving the ability to capture stdout and monkey patch other behaviors (file modified time detection).

This refactoring revealed some bugs about how the stream handling was done.

This approach gives us more control when testing the mappings.

Note that the CLI executable is still exercised in test_help*.

  • Simply import the module.
  • Allow args to be passed in explicitly (to facilitate testing).
  • Use sys namespace.
  • In test_sample, exercise the code in process.
  • Fix resource warnings about unclosed source.
  • Freeze time and bypass file mtime check for to avoid passing a fixed date with each command.

@jaraco jaraco merged commit b8563a8 into main Apr 6, 2025
23 checks passed
@jaraco jaraco deleted the feature/freeze-time branch April 6, 2025 20:33
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