synapse/tests/rest
Erik Johnston b74c29f694
Move towards a dedicated Duration class (#19223)
We have various constants to try and avoid mistyping of durations, e.g.
`ONE_HOUR_SECONDS * MILLISECONDS_PER_SECOND`, however this can get a
little verbose and doesn't help with typing.

Instead, let's move towards a dedicated `Duration` class (basically a
[`timedelta`](https://docs.python.org/3/library/datetime.html#timedelta-objects)
with helper methods).

This PR introduces the new types and converts all usages of the existing
constants with it. Future PRs may work to move the clock methods to also
use it (e.g. `call_later` and `looping_call`).

Reviewable commit-by-commit.
2025-11-26 10:56:59 +00:00
..
admin Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
client Move towards a dedicated Duration class (#19223) 2025-11-26 10:56:59 +00:00
key Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
media Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
synapse Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_health.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_well_known.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00