Skip to content

Conversation

@cadu-leite
Copy link
Owner

…t, black-box testing strategy that executes the script as a subprocess.

The new test suite in tests/test_cli.py now verifies the script's stdout, stderr, and exit codes, providing you with more realistic and comprehensive coverage.

While writing the new tests, I also discovered and fixed two bugs:

  • I added graceful error handling to the main function to prevent unhandled exceptions on invalid date input.
  • I replaced the permissive date-parsing regex with a stricter version to correctly reject invalid date formats.

…t, black-box testing strategy that executes the script as a subprocess.

The new test suite in `tests/test_cli.py` now verifies the script's stdout, stderr, and exit codes, providing you with more realistic and comprehensive coverage.

While writing the new tests, I also discovered and fixed two bugs:
- I added graceful error handling to the main function to prevent unhandled exceptions on invalid date input.
- I replaced the permissive date-parsing regex with a stricter version to correctly reject invalid date formats.
…t because different versions of Python's `argparse` module produce different headers for the optional arguments section ('options:' vs. 'optional arguments:').

This commit makes the test more robust by checking for the presence of either header, ensuring the test is not dependent on the specific Python version used in the execution environment.
@cadu-leite cadu-leite merged commit 91d4b19 into master Aug 7, 2025
4 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.

1 participant