Closed dgw closed 11 months ago
Well, there are no direct tests of this module… Even though CI passes, I don't really trust it that much.
I've started work on a test/tools/test_tools_calculation.py
suite. But that's out of scope of this PR, and doesn't need to be done for 8.0 specifically, so I will mark this as ready for review and just show up with the test suite later when I'm done with it.
Had a go at writing a basic set of tests for tools.calculation
if you'd like to add them to this PR. Also wrote some up for the calc, dice
plugins, I've opened #2503 for those (but can add the test listed here to that one if you'd prefer, let me know)
Had a go at writing a basic set of tests for
tools.calculation
if you'd like to add them to this PR.
I've adopted them into my WIP branch for adding tests to this module. This PR is already double-approved, and I'd rather not kibosh that status. 😁 But I appreciate that your quick patch gets the module to 81% coverage already! I'll have a look at the helpers and error cases at my leisure, probably for submission to the 8.1 cycle (coincidence?).
ast.Num
and friends have been deprecated since Python 3.8, but only started to generate warnings in Python 3.12 prereleases.Feels like stdlib made a bad trade here, simplifying Python internals in exchange for making users write uglier, more complicated type checks such as this. But it's been so long, it's not as if they'll un-deprecate the older, more-convenient-for-the-user classes.
Compatibility
I was under the impression that
ast.Constant
would work as far back as Python 3.6, but apparently not. This change has to wait until we're ready to drop Python 3.7.Checklist
make qa
(runsmake quality
andmake test
)