Commit Graph

5 Commits

Author SHA1 Message Date
WMOkiishi f7f3179a89 Move test code from across `direct` to proper test modules
Closes #1480
2023-08-02 08:37:51 +02:00
rdb 3732d3f1e6 PythonUtil: Fix Python 3 next() for SerialNumGen, AlphabetCounter 2021-03-22 21:49:58 +01:00
rdb c646924f03 tests: remove occasionally-failing PythonUtil.weightedChoice test
It does not test a behavior of this function that we support, anyway.
2020-09-14 11:01:01 +02:00
pythonengineer 46a3a72029 PythonUtil: weightedChoice should throw IndexError on empty list
Also includes a unit test.

Closes #682
2019-07-15 19:39:31 +02:00
rdb f986f8de1b showbase: add back clampScalar and PriorityCallbacks to PythonUtil
These were removed by 88dbb31daa under the assumption that they were not used, but it has recently come to my attention that there is still code out there that uses these.

PriorityCallbacks has been updated to be compatible with Python 3 by only comparing the priority, rather than the (priority, callback) tuple. This also has the side-effect of ditching the bisect dependency.

Also moves testing code from the source to the unit tests.
2018-04-21 11:43:46 +02:00