Skip to content

Conversation

@Exirel
Copy link
Contributor

@Exirel Exirel commented Apr 22, 2023

Evolved description

  • Breaking: validate_timezone() raises ValueError even if passed None now, instead of returning None
  • "Duration" named tuple returned from seconds_to_split() function
  • Added tests to cover original & fixed behaviors

Original description

Tin. Oh, and also I added type annotations and fixed the resulting type errors.

I ensure that the tests all pass on the current version of sopel.tools.time, then I added type annotations, so there is a guarantee that it works pretty much as it did before... except for a bug I fixed where you could call a function without a db and it would raise an AttributeError because NoneType doesn't have the right method.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@Exirel Exirel added Tests Bugfix Generally, PRs that reference (and fix) one or more issue(s) Housekeeping Code cleanup, removal of deprecated stuff, etc. labels Apr 22, 2023
@Exirel Exirel added this to the 8.0.0 milestone Apr 22, 2023
@Exirel
Copy link
Contributor Author

Exirel commented May 6, 2023

Did all the change as requested, ready for another review.

@Exirel Exirel requested a review from dgw May 6, 2023 15:27
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

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

Couple ideas… My procrastination on $work stuff is your gain!

@Exirel Exirel force-pushed the test-coverage-tool-time branch from 549d9fc to 7b9445f Compare May 29, 2023 14:59
@Exirel
Copy link
Contributor Author

Exirel commented May 29, 2023

I squashed the fix commit on the parent's commit, so you shouldn't have issue with changes from master!

@Exirel Exirel requested review from SnoopJ and dgw May 29, 2023 15:06
@dgw dgw changed the title test: fully cover sopel.tools.time tools.time: tweaks & tests May 30, 2023
@dgw dgw added the Breaking Change Stuff that probably should be mentioned in a migration guide label May 30, 2023
Copy link
Contributor

@SnoopJ SnoopJ left a comment

Choose a reason for hiding this comment

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

I have no more remarks for this, LGTM

Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

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

I'll make CliffsNotes on behavior changes to mention in the changelog by editing the OP.

@dgw dgw merged commit ed726e6 into sopel-irc:master Jun 3, 2023
@Exirel Exirel deleted the test-coverage-tool-time branch June 15, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change Stuff that probably should be mentioned in a migration guide Bugfix Generally, PRs that reference (and fix) one or more issue(s) Housekeeping Code cleanup, removal of deprecated stuff, etc. Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants