ariebovenberg / whenever

⏰ Sensible and typesafe datetimes for Python
https://whenever.rtfd.io
MIT License
361 stars 7 forks source link

Consistent parse exceptions #106

Closed davila-vilanova closed 2 months ago

davila-vilanova commented 2 months ago

Description

Addresses issue https://github.com/ariebovenberg/whenever/issues/94.

Summary of changes

Checklist

ariebovenberg commented 2 months ago

Thanks @davila-vilanova for your PR, I'll have a look shortly.

Could you rebase your branch though?

ariebovenberg commented 2 months ago

Looks like a test coverage gap appeared. You can find it with pytest --cov=whenever --cov-report html and opening htmlcov/index.html

davila-vilanova commented 2 months ago

Branch rebased.

The coverage gap came from two raise statements that were not supposed to ever execute within the then current possible codepaths but were there in case the happy path condition got out of sync with the individual error checks under it, as a kind of insurance.

They are no longer necessary as I've removed the individual error checks -- coverage is back to 100%.

ariebovenberg commented 2 months ago

🙏 thanks for your contribution! It may be a while before this rolls out in a release though, since it's technically a backwards incompatible change (an exception was removed) and I'd like to bundle it with others if possible.

davila-vilanova commented 2 months ago

🙏 thanks for your contribution!

Thank you!

it's technically a backwards incompatible change (an exception was removed) and I'd like to bundle it with others if possible.

Makes sense.