Python upstream is trying to eliminate tz-naive date functions that
imply anything to do with a timezone, even UTC. They have deprecated
datetime.datetime.utcnow() in Python 3.12 and thus running tests emits
many warnings for us.
We switch to instantiate datetime objects taht are intended to reflect
UTC to have a timezone, or if we instantiate naive ones and then later
convert, we do the full conversion.
After the changes, the tests still work on Python 3.9, but now also on
Python 3.12 without warnings.
See PR description for #632 for more details.
Signed-off-by: Scott Mcdermott <scott@smemsh.net>
Use interval array to determine whether there is data to display
Move interval truncation outside the loop, combine/rework 'no data' messages
Close#450
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
datetime.timedelta stores days, seconds and microseconds. Therefore the
seconds attribute only stores timedeltas of less than 24 hours. Use
total_seconds() instead which properly accounts for the days part.
- add main
- move algorithm to function
- use __future__ module
- introduce new style formatting
- restructure test_totals.t accordingly
- add test for empty range
- add tests for colored output
- Convert UTC time to local time in output
- Change single quote to double quote
- Use new style python formatting
- Make tests use current time
- Fix test for open interval
- Improve totals.py extension script:
- Fix display issue if tags are shorter than string 'Totals'
- Fix issue when totals.py is called on empty database
- Add tests: test_totals.t